You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 2, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 2, 2023. It is now read-only.
PTVSD needs to wait for a little while before closing the socket after sending the last message #530
PTVSD shuts down even before VSC receives the entire packet
Expected behavior
PTVSD Should wait for some random time waiting for VSC to receive the message before terminating the socket.
Possible solutions
Note: VSC has a slight delay of 100ms for such situations (e.g. if PTVSD dies, or user kills the PTVSD process manually, etc). In such cases VSC sends the terminated event.
Solution 1: We could do the same here, if disconnect request is received with a restart flag, PTVSD can wait for 100ms before killing the socket. Solution2:
First send the response, then invoke notify_disconnecting
This seems to work. Would prefer to still add the delay based on the restart flag in the disconnect request. A delay of 100ms.
For solution 2 is it a custom message? If so then this won't work for VS.
Not following you. How should this effect VS. Unless VS also passes the restart flag in the disconnect request. Besides, this is merely a delay of 100ms. I.e. if anything, VS will only see a delay.
So, this issue will not fix nor break anything in VS. This issue is for VSC only.
FWIW, I've landed a few PRs that improve the situation. Apparently they do not quite solve the problem yet, though. Per Don, the sys.exit() call blocks indefinitely. I have not seen this issue in our tests, but who knows.
Activity
DonJayamanne commentedon Jun 27, 2018
Karthik Nadig (@karthiknadig) Eric Snow (@ericsnowcurrently)
This is yet another reason to work on microsoft/vscode-python#1367
karthiknadig commentedon Jun 27, 2018
For solution 2 is it a custom message? If so then this won't work for VS.
DonJayamanne commentedon Jun 27, 2018
Not following you. How should this effect VS. Unless VS also passes the
restartflag in thedisconnectrequest. Besides, this is merely a delay of100ms. I.e. if anything, VS will only see a delay.So, this issue will not fix nor break anything in VS. This issue is for VSC only.
karthiknadig commentedon Jun 27, 2018
No. It does not. I have to check with the Adapter Host folks about this.
On restart, they terminate the debuggee (see above message) and start another session.
Send the disconnect response before closing the client socket. (#531)
Use sys.exit() instead of os.kill(). (#538)
ericsnowcurrently commentedon Jun 27, 2018
FWIW, I've landed a few PRs that improve the situation. Apparently they do not quite solve the problem yet, though. Per Don, the sys.exit() call blocks indefinitely. I have not seen this issue in our tests, but who knows.
DonJayamanne commentedon Jun 29, 2018
Eric Snow (@ericsnowcurrently) I've created some tests for this in #539 (currently disabled and incomplete).
8 remaining items
DonJayamanne commentedon Aug 2, 2018
Time to clean up the hack.
karthiknadig commentedon Aug 18, 2019
The out-of-proc debug adapter handles cleanly shutting down debuggee process and issues the relevant messages in case the debuggee is killed by user.