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

Don't change already suspended threads in subsequent suspend calls #296

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lukejriddle
Copy link
Contributor

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

@fabioz
Copy link
Owner

fabioz commented Dec 3, 2024

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.

@lukejriddle
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@lukejriddle
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants