-
Notifications
You must be signed in to change notification settings - Fork 142
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
Launching VSCode debugpy takes significantly longer to attach to process after update to 1.6.2 #1003
Comments
One change in the attach is related to the shared libraries scanned at attach time with Previously we specified the libraries needed to get Anyways, the way to fix this for you is setting an environment variable saying which are the shared libraries that must be scanned. You can do this by setting the following environment variable:
Please let me know if doing that fixes it for you. |
Actually, rereading I'm not sure this is actually it... does this happen in an attach to situation or just running your app (and the issue is that running your use case is slower)? If it's the case that it's just slower to run, do you think you could provide some code to showcase what's slower in the current version vs the previous version? |
Thanks for the speedy response. I believe this is an attach to situation. I have a Here is the output when running the configuration: The slowdown is before the app starts executing code. If I set a breakpoint, I can see that it stalls when importing I tried setting |
If you set |
I tried |
You actually need to do that in the shell that starts VSCode itself (if you do that, does it work?) |
I was thinking about how to deal with this... ideally we'd be able to show to the user a message saying that the attach is taking longer than expected after some time and notify about customizing the @int19h do you think it'd be possible for vscode-python to show the output that's given from the debugger during the attach? If the output is shown in Also, the debugger is in kind of a crossroad here. Either it goes to the |
We don't propagate events from the server until after we send the "attach" response. debugpy/src/debugpy/adapter/clients.py Lines 579 to 582 in 646d921
We could special-case "output" by propagating them as soon as client connects. That would change their order wrt all other events that might happen during initialization, but I think it should be safe for output. |
In this particular case, we are pre-connection. i.e.: we want to show the output of the process spawned for the attach (which is currently put in the logs at: https://github.com/microsoft/debugpy/blob/v1.6.3/src/debugpy/adapter/servers.py#L555). |
Ah, I see now. That method is called from the "attach" request handler, so there's a client connection to which output could be propagated. However, we probably also don't want to propagate everything - IIRC, some of it is diagnostic, and we really just want the errors/warnings. Maybe use stdout and stderr to separate these? Currently this only captures stdout, but it really should capture both. |
Yes, you're right that some of it may be too much info... I think separating stdout/stderr can make sense to show only errors -- right now it prints everything to stdout. Although I must say that if there's some kind of progress UI maybe it'd be nice to show the stdout too so that the user can get a sense of what's happening -- and if an error actually happens showing the stdout can also help in tracking down what may be the actual problem. |
I'll take a look at sending those as output events. |
Before creating a new issue, please check the FAQ to see if your question is answered there.
Environment data
Actual behavior
Attaching the debugger takes significantly longer (22 minutes) to start up my app.
Expected behavior
Around 17 seconds build time with the same code.
Steps to reproduce:
launch.json
settings and app code are the samepython-jose
version 3.0.1Can provide more info upon request
The text was updated successfully, but these errors were encountered: