[openstack-dev] Problem with debugging program having eventlet.monkey_patch() code

Michael J Fork mjfork at us.ibm.com
Fri Aug 17 12:58:03 UTC 2012


We have found that Winpdb (http://winpdb.org/ - platform independent
despite Win in the name) works well with multi-threaded Python.  While
using PyDev for development, run Winpdb as a remote debugger for the
multithreaded service.  Flow is like this:

Launch Winpdb GUI
# winpdb

Start Debugging
# cd /home/openstack-dev/workspace/nova/bin
# winpdb -d -r <file_to_debug>
Set Password: openstack

Attach to Process
1) In Winpdb GUI, select File -> Attach
2) Enter password from step 4, should display files associated with that
password
3) Select process/file then select OK

To Stop Debug or Make Changes and Restart
1) File -> Stop to detach current debugger
2) Make changes in Eclipse and Save (make sure development user has write
privileges to repository)
3) kill and restart winpdb debugging process started above
4) Re-attach to the process in the Winpdb GUI

Michael

-------------------------------------------------
Michael Fork
Cloud Architect, Emerging Solutions
IBM Systems & Technology Group

michel.gauthier at bull.net wrote on 08/17/2012 07:59:18 AM:

> From: michel.gauthier at bull.net
> To: openstack-dev at lists.openstack.org,
> Date: 08/17/2012 08:02 AM
> Subject: [openstack-dev] Problem with debugging program having
> eventlet.monkey_patch() code
>
> Hi all,
> I want to debug nova-scheduler service (Essex version)  code with
> Eclipse->Pydev->Debug Configuration.
> But when I launch it under Debug Configuration, I get the following
> error messages :
>
> pydev debugger: starting
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line
> 336, in fire_timers
>     timer()
>   File "/usr/lib/python2.7/dist-packages/eventlet/hubs/timer.py",
> line 56, in __call__
>     cb(*args, **kw)
>   File "/usr/lib/python2.7/dist-packages/eventlet/semaphore.py",
> line 95, in _do_acquire
>     waiter.switch()
> error: cannot switch to a different thread
>
> and then, Pydev debugger does not work!
>
> In fact, these errors are due to the use of eventlet.monkey_patch()
inside
> nova-scheduler launcher (as well as inside other nova-* launchers).
>
> Do you have any ideas to resolve this problem?
>
> Thanks in advance._______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20120817/4fe7fc8c/attachment.html>


More information about the OpenStack-dev mailing list