microsoft / debugpy

An implementation of the Debug Adapter Protocol for Python
https://pypi.org/project/debugpy/
Other
1.87k stars 139 forks source link

Watch variables de-activates debugger (breakpoints and code-stepping fails) with GEVENT #1743

Open felmoreno1726 opened 1 week ago

felmoreno1726 commented 1 week ago

Environment data

Actual behavior

Whenever a Watch Variable is defined, only the first breakpoint is hit. Subsequent breakpoints are ignored and the code will continue executing without stopping at a subsequent breakpoint. Also stepping-in or stepping-over becomes disabled and the code will just resume execution afterwards.

Expected behavior

The expected behavior is that the debugger is able to control the execution of the program: stepping through lines of code, stepping-in and stopping at subsequent breakpoints. (Even if Watch Variables are defined).

Steps to reproduce:

  1. I'm running a Flask application with Gevent workers and monkey_patch enabled.
  2. The environment variable GEVENT_SUPPORT = True (However annoying warnings are still present)
Please set an environment variable with:
GEVENT_SUPPORT=True
to enable gevent support in the debugger.
felmoreno1726 commented 5 days ago

I go the following out of DEBUG CONSOLE output:

`Exception ignored in thread started by: <bound method Thread._bootstrap of <WriterThread(pydevd.Writer, started daemon 140290625427136)>> Traceback (most recent call last): File "/usr/lib64/python3.12/threading.py", line 1032, in _bootstrap self._bootstrap_inner() File "/usr/lib64/python3.12/threading.py", line 1079, in _bootstrap_inner self._delete() File "/usr/lib64/python3.12/threading.py", line 1111, in _delete del _active[get_ident()]


KeyError: 140290516462976`

Let me know if you need additional information to reproduce the issue.
rchiodo commented 3 days ago

Do you have a sample app that I can use to try this out?