-
Notifications
You must be signed in to change notification settings - Fork 143
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
Remote attach debug server not dying upon killing the attached process #1783
Comments
@zbs In this case is the debugger process (i.e., python -m debugpy) terminated? or is that also blocked. Moving this to If |
I can't seem to reproduce this myself. Can you turn on logging and send back the logs? They'll end up on the remote machine. It should say if the debugger sent the terminate or not. |
Thanks all. Running with logging and will report back
Yes AFAICT it's properly killed. |
OK repro'd again. This time, steps were
I have the logs, how should I send them, or what should I extract from them? |
You can just zip them and drop the zip file in the issue. |
We might need the VS code side logs too, that would be using the |
There should have been some pydevd logs too, not sure why those didn't show up. There were four instances of the debugger starting. Two looked like it was killed by the keyboard interrupt and the client responded with the disconnect. The other two look like it failed to connect. I'd fix this part first though. You're using a super old debugpy on the server. Not sure how it even works:
Debugpy's latest is 1.8.11 |
You might also use a newer CPython, as that version isn't technically supported anymore. |
Ah, that's probably why. I'll ask our internal maintainer of that conda environment to bump the debugpy version. After you pointed that out, I've switched back to our main environment, which has version 1.8, and I have yet to repro this issue. Since that seems like the strongest lead, we can probably close this out unless I encounter this problem again. Thanks for all the help and sorry for the time waste. |
OK looks like this still repros with 1.8. One thing I observed is that when I get in this state, the debug extension on the left hand side has a blue 1, and upon hover, it says "1 active session". However there's no debug control modals (or blue bar on the bottom) indicating a debug session is actually happening |
And this is after you've killed all the processes on the server? Does the process list include anything with debugpy in it? |
yes
there were other debugpy servers attached to different ports. I killed them but I'm still blocked from starting another debug session |
This might be a red herring, but I noticed that if I click the "Play" button when it's in this state, nothing happens; however, when I do CTRL + ALT + F10 (which I have bound to the command |
Is this server shared with other people? How were there other debugpy instances running? I think if you just killed them it didn't shutdown correctly. Hitting CTRL+C on the app when it's running should send the correct shutdown, but killing all of the debugpy processes isn't going to send the terminate across. Launching the debugger starts a number of different processes. |
Yes but that's moot -- I run several workspaces off this remote host, and have different workspaces associated with different ports for remote debug attaching. |
We likely need the log on both sides to see what the last thing that VS code saw was. |
OK, which of these files?
|
There should be a bunch of log files. Hmm, maybe it wouldn't work in remote, but I thought the extension (vscode-python-debug) wrote out the VS code side. It should happen if you add |
Type: Bug
Behaviour
Extremely frequently the VS Code remote attach debugger will not die when I kill the
python -m debugpy ...
process that is attaching to the port 5678. Until I restart the IDE I cannot start debugging again, because otherwise it will complain that "Python debugger is already debugging another instance". My colleaques haven experiened this issue as well, and it seems to be a recent regression (last couple of weeks).As I wrote this, I cannot click the "Create on GitHub" button because VSCode is seeming unresponsive. I resolved by restarting the IDE.
Steps to reproduce:
python -m debugpy --wait-for-client --listen 5678 /path/to/module.py
Diagnostic data
launch.json
configurationOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output for
Python Debugger
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython Debugger
)Extension version: 2024.15.2024121301
VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 4.18.0-372.32.1.el8_6.x86_64
Remote OS version: Linux x64 4.18.0-372.32.1.el8_6.x86_64
Remote OS version: Linux x64 4.18.0-372.32.1.el8_6.x86_64
Connection to 'SSH: zbs-carp2' could not be established Canceled
Remote OS version: Linux x64 4.18.0-372.32.1.el8_6.x86_64
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Connection to 'SSH: zbs-carp2' could not be established Canceled
A/B Experiments
The text was updated successfully, but these errors were encountered: