Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race between IDE and server connecting to the adapter #1901

Closed
int19h opened this issue Nov 8, 2019 · 0 comments
Assignees
Labels
Bug

Comments

@int19h
Copy link
Contributor

@int19h int19h commented Nov 8, 2019

When using ptvsd.enable_attach(), there is a brief period of time when the server spawned the adapter, and the adapter has opened the port to listen for incoming IDE connections, but the server hasn't connected to the adapter yet. If the IDE connects to the adapter at that point, it will reject the connection because there's no server.

This is pretty hard to repro outside of tests because of how small the window of opportunity is. But in the tests, it can happen under load, because debug.Session tries to connect to the adapter as soon as it sees an open port.

@int19h int19h added the Bug label Nov 8, 2019
@int19h int19h self-assigned this Nov 8, 2019
int19h added a commit to int19h/ptvsd that referenced this issue Nov 11, 2019
Fix microsoft#1901: Race between IDE and server connecting to the adapter

Use "evaluate" request without "frameId" to import ptvsd into the debuggee as soon as server attaches.

If the adapter is spawned by the server, wait for server to connect if IDE connects first.

Fix test_subprocess to use the new test API, and add a check for ptvsd being loaded in the child process.
@int19h int19h closed this in e1d5543 Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.