Repository navigation
gh-160683: Stop half-closing the remote debugging interrupt socket - #160716
Open
summeriver13 wants to merge 1 commit into
Open
summeriver13 wants to merge 1 commit into
summeriver13 wants to merge 1 commit into
Conversation
summeriver13
force-pushed
the
fix/remote-pdb-idle
branch
from
October 26, 2026 16:14
66108ba to
4901248
Compare
Author
|
All checks are green, including the Windows builds. @gaogaotiantian, could you review this? It only touches The new test starts the listener in a subprocess and asserts that the accepted socket never sees EOF. It fails in 147 ms without the change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The interrupt channel is write-only. The client only calls
sendall()on it(
Lib/pdb.py:3517), and the target only reads. Half-closing the target's write sidetherefore sent a FIN that no one consumed, and Windows keeps a half-closed connection
in FIN_WAIT_2 for 120 seconds and then resets it. An idle debugging session silently
lost its interrupt channel.
Dropping the call leaves the connection in ESTABLISHED until one end closes it.
Nothing else changes: the listener still polls with a 0.25 s timeout, so it can exit
when the interpreter shuts down.
The half-close came in with the first version of the listener (5993e06, gh-132975).
Its author confirmed that it was only meant to document the one-way direction:
#160683 (comment)
The new test starts
_PdbServer._start_signal_listener()in a subprocess and assertsthat the accepted socket never sees EOF. With the half-close put back, it fails in
147 ms, so it does not depend on the 120 s timer; with this change it passes.
I ran
python.exe -m test test_remote_pdb test_pdbon Windows 11 (26100) with aRelease/MSVC build: 289 tests run, 17 skipped, all pass. This affects 3.14 and 3.15
as well; both branches have the same listener.
Fixes #160683