PyDev.Debugger icon indicating copy to clipboard operation
PyDev.Debugger copied to clipboard

Don't change already suspended threads in subsequent suspend calls

Open lukejriddle opened this issue 1 year ago • 4 comments

Previously, already-suspended threads could still be modified by subsequent calls to suspend_all_threads. This change adds checks to prevent this.

lukejriddle avatar Dec 03 '24 15:12 lukejriddle

This doesn't seem correct (which is probably why tests are failing).

I guess I also don't understand the real issue behind the need for this change.

fabioz avatar Dec 03 '24 16:12 fabioz

We've encountered some issues where upon reaching a breakpoint location, pydevd will try to suspend all other threads. But at this point, another thread might race and reach this codepath as well and try to suspend all threads as well, before the suspended state notification is fired. This can cause pydevd not to emit a thread suspend notification (i.e. to debugpy and thus to VS Code), so the debugger UI never refreshes even though breakpoints where hit.

I'm trying to figure out the tests before I publish this. They all seem related to django?

lukejriddle avatar Dec 03 '24 17:12 lukejriddle

Thought I had a fix but didn't. Will revisit this later

lukejriddle avatar Dec 03 '24 20:12 lukejriddle

@fabioz Any advice running the tests_python locally? I followed a similar setup to the GitHub actions workflow on a Linux host but am running into timeout errors in pytest.

lukejriddle avatar Dec 05 '24 17:12 lukejriddle