GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — Problems resuming multiple threads if in_process_debug_adapter is True · Issue #2011 · microsoft/debugpy Open Labels Fixed in next releaseThis issue has been fixed, but won't be available to customers until the next release. DescriptionEnvironment data
Actual behaviorWhen attaching to a debugpy instance with an in-process adapter, if there are multiple threads then only one thread gets resumed after pressing 'continue' instead of all of them, and it desyncs from the visual state in VS code as it thinks all threads are running. Expected behaviorAttaching to a debugpy instance with an in-process adapter should behave the same as with a separate adapter process, if there is only one process being debugged. For my real use case I'm trying to debug python embedded in an application, so using the out-of-process adapter would be difficult and much less convenient. Steps to reproduce:
import threading, time, sys if 'debugpy' not in sys.modules.keys(): import debugpy debugpy.configure(subProcess=False) debugpy.listen(5678, in_process_debug_adapter=True) def f(): for i in range(100): print(f"Thread {i}") time.sleep(0.3) threading.Thread(target=f).start() for i in range(100): print(f"Main {i}") time.sleep(0.3)
LogsFrom running with Working case, out of process adapter: debugpy.server-20952.log Broken case, in-process adapter: debugpy.server-27444.log Thoughts/findingsI've separated out what I think is happening, since I'm not much of a python programmer, I'm unfamiliar with these codebases and the DAP. This may be misguided nonsense, please ignore if so 😄. The key difference seems to be this (working): vs this (broken): Tracing it through, VS Code always sends a When there's no separate adapter process, the threadId goes directly(?) to pydevd which then resumes only that one single thread. pydevd returns two responses - one from the requested single-notification mode which says I tried hacking around this. Forcing pydev to resume all threads unsurprisingly behaves correctly. Hacking the return data from I'm not sure what the fix should be. From the docs in So maybe pydevd is incorrect in resuming only one thread when the threadId is passed and it should always behave like Reacted by Copilot Activity
MetadataMetadataAssigneesLabelsFixed in next releaseThis issue has been fixed, but won't be available to customers until the next release. TypeProjectsMilestoneRelationshipsDevelopmentIssue actions | ||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |