#debugpy becomes unresponsive after rapid breakpoint suspend/resume cycles in multithreaded Python programs
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia con la riproduzione multithread minima e traccia la gestione dei breakpoint attraverso pydevd_sys_monitoring._stop_on_breakpoint e _do_wait_suspend. Confronta Suspend, le richieste rapide di Continue, la pulizia dello stato dei thread e l’ordine degli eventi DAP in cicli ripetuti. Il lavoro è completato quando la sessione rimane reattiva e i breakpoint continuano a comportarsi normalmente senza richiedere un riavvio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
debugpy becomes unresponsive after rapid breakpoint suspend/resume cycles in multithreaded Python programs
Description
I found an issue where the debug session becomes unresponsive after repeatedly hitting a breakpoint and rapidly pressing F5 (Continue/Resume) in a multithreaded Python application.
The issue can be reproduced with a minimal example.
It does not appear to be specific to Python 3.14 free-threading, because the same behavior can also be reproduced on CPython 3.11.9.
The problem appears to be related to repeated breakpoint suspend/resume cycles and thread state handling inside debugpy/pydevd.
Environment
OS:
Windows 11
Debugger:
VS Code Python Debugger extension
debugpy: latest version
Python versions tested:
- CPython 3.11.9
- CPython 3.14.6
- CPython 3.14.6 free-threaded build (python3.14t)
Minimal Reproduction
import threading
import time
def worker():
while True:
x = 1
time.sleep(1) # Put breakpoint here
for i in range(2):
threading.Thread(target=worker).start()
while True:
time.sleep(1)
Steps to Reproduce
- Open the script in VS Code.
- Set a breakpoint on time.sleep(1) inside worker().
- Start debugging with F5.
- When the breakpoint is hit, press F5 (Continue).
- Repeat rapid F5 Continue operations.
- After several suspend/resume cycles, the debugger becomes unresponsive.
Expected Behavior
Breakpoint suspend/resume cycles should continue normally.
Actual Behavior
After several rapid F5 Continue operations:
- VS Code stops updating the current debug location.
- Breakpoints no longer behave normally.
- The debugger UI becomes stuck.
- Restarting the debug session is required.
Technical Observation
Breakpoint handling reaches:
_pydevd_sys_monitoring._stop_on_breakpoint
and:
_do_wait_suspend()
The suspend path is entered successfully.
Possible affected areas:
- pydevd suspend/resume state management
- debugpy adapter DAP event ordering
- handling of rapid continue requests
- multithreaded breakpoint synchronization
Questions
Could this be related to a race condition in debugpy regarding:
- Rapid suspend/resume cycles?
- Multiple threads hitting the same breakpoint?
- Thread state cleanup after continue?
- DAP event ordering?
- Lingua principale
- Python
- Stelle
- 2.5k
- Fork
- 202
- Merge medio
- 1g 20h
- PR unite (30g)
- 3
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/debugpy
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Document "rules"-optionApertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Adapter bootstrap fails with ConnectionRefusedError on WSL2 VirtioProxy or hostAddressLoopbackAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di microsoft/debugpy
Issue simili
-
#bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
apache/superset#44923 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
lawndoc/stack-back#123 ·
-
Add: EntuneAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
AbdelStark/awesome-typesafe-jev#187 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
repowise-dev/repowise#2966 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 2 giorni