PyDev 3.9.2 - Unable to attach debugger to gevent based processes

I'm having problems connecting to gentent-based processes with the PyDev debugger in PyDev 3.9.2.

It works great in PyDev 3.9.1 and LiClipse 3.9.1, but not with 3.9.2, which is the last PyDev right now (February 6, 2015).

It also works correctly when part of the code is run directly from the PyDev debugger, and not from the outside.

Please note that this does not depend on whether control points are set (enabled or not) - a simple fact of joining the process is enough to exclude it.

Here is an example module for reproducing behavior with two exceptions: one from PyDev and the other from the gentent code point.

Can anyone shed some light on him? Many thanks.

from gevent.monkey import patch_all
patch_all()

import threading
import gevent

def myfunc():
    t = threading.current_thread()
    print(t.name)

while True:
    gevent.spawn(myfunc)
    gevent.sleep(1)

Debug Server at port: 5678
Traceback (most recent call last):
  File "/opt/slow/01/data/install/pydev/eclipse/plugins/org.python.pydev_3.9.2.201502050007/pysrc/pydevd_attach_to_process/attach_script.py", line 16, in attach
    patch_multiprocessing=False,
  File "/opt/slow/01/data/install/pydev/eclipse/plugins/org.python.pydev_3.9.2.201502050007/pysrc/pydevd.py", line 1828, in settrace
    patch_multiprocessing,
  File "/opt/slow/01/data/install/pydev/eclipse/plugins/org.python.pydev_3.9.2.201502050007/pysrc/pydevd.py", line 1920, in _locked_settrace
    CheckOutputThread(debugger).start()
  File "/opt/slow/01/data/install/pydev/eclipse/plugins/org.python.pydev_3.9.2.201502050007/pysrc/pydevd.py", line 261, in start
    thread.start()
  File "/usr/lib/python2.7/threading.py", line 750, in start
    self.__started.wait()
  File "/usr/lib/python2.7/threading.py", line 620, in wait
    self.__cond.wait(timeout)
  File "/usr/lib/python2.7/threading.py", line 339, in wait
    waiter.acquire()
  File "_semaphore.pyx",...

Traceback (most recent call last):
  File "/opt/slow/01/data/install/pydev/eclipse/plugins/org.python.pydev_3.9.2.201502050007/pysrc/pydevd_attach_to_process/attach_script.py", line 16, in attach
    patch_multiprocessing=False,
  File "/opt/slow/01/data/install/pydev/eclipse/plugins/org.python.pydev_3.9.2.201502050007/pysrc/pydevd.py", line 1828, in settrace
    patch_multiprocessing,
  File "/opt/slow/01/data/install/pydev/eclipse/plugins/org.python.pydev_3.9.2.201502050007/pysrc/pydevd.py", line 1920, in _locked_settrace
    CheckOutputThread(debugger).start()
  File "/opt/slow/01/data/install/pydev/eclipse/plugins/org.python.pydev_3.9.2.201502050007/pysrc/pydevd.py", line 261, in start
    thread.start()
  File "/usr/lib/python2.7/threading.py", line 750, in start
    self.__started.wait()
  File "/usr/lib/python2.7/threading.py", line 620, in wait
    self.__cond.wait(timeout)
  File "/usr/lib/python2.7/threading.py", line 339, in wait
    waiter.acquire()
  File "_semaphore.pyx", line 112, in gevent._semaphore.Semaphore.acquire (gevent/gevent._semaphore.c:3004)
  File "/home/dsuch/projects/pydev-plugin/pydev-plugin/local/lib/python2.7/site-packages/gevent/hub.py", line 330, in switch
    switch_out()
  File "/home/dsuch/projects/pydev-plugin/pydev-plugin/local/lib/python2.7/site-packages/gevent/hub.py", line 334, in switch_out
    raise AssertionError('Impossible to call blocking function in the event loop callback')
AssertionError: Impossible to call blocking function in the event loop callback
+4

All Articles