Repository navigation
gh-160683: Stop half-closing the remote debugging interrupt socket - #160716
summeriver13 wants to merge 1 commit into
Conversation
66108ba to
4901248
Compare
|
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. |
cfbolz
left a comment
There was a problem hiding this comment.
looks good to me, apart from my one comment
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
4901248 to
02bad36
Compare
|
I have made the requested changes; please review again. @cfbolz I removed the comment block in Test results on a native Windows build (Python 3.16.0a1+dev):
|
|
Thanks for making the requested changes! @cfbolz: please review the changes made to this pull request. |
cfbolz
left a comment
There was a problem hiding this comment.
I am fine with this. @godlygeek would you have time to take a quick look too?
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