#debugpy becomes unresponsive after rapid breakpoint suspend/resume cycles in multithreaded Python programs
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza con la reproducción multihilo mínima y sigue el manejo de breakpoints a través de pydevd_sys_monitoring._stop_on_breakpoint y _do_wait_suspend. Compara Suspend, las solicitudes rápidas de Continue, la limpieza del estado de los hilos y el orden de los eventos de DAP en ciclos repetidos. Se considera terminado cuando la sesión sigue respondiendo y los breakpoints continúan comportándose normalmente sin requerir un reinicio.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- Python
- Estrellas
- 2.5k
- Forks
- 205
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 3
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/debugpy
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Document "rules"-optionAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Adapter bootstrap fails with ConnectionRefusedError on WSL2 VirtioProxy or hostAddressLoopbackAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Todos los issues de microsoft/debugpy
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mikf/gallery-dl#9791 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
fossasia/eventyay#6151 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
P4: low tooling
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
jeffknupp/association#318 ·
-
azure-cost bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/GitHub-Copilot-for-Azure#3330 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
raullenchai/Rapid-MLX#4097 ·
Los mantenedores suelen responder en 1 día