[wingide-users] Debugging a multi-process python code

Wingware Support support at wingware.com
Thu Apr 25 10:52:17 EDT 2013

William Ray Wing wrote:
> I'm struggling to debug a rarely-occurring exception in a running code which uses the python multiprocess library to spawn off multiple sub-jobs.  The exception happens less than once a month (or so) in code that is running7/24.   I strongly suspect that the bug is in the multi-process library itself (specifically in pool), and is triggered when an external event randomly happens to affect more than one of the sub-processes simultaneously.  The traceback I get points to the "get"  routine in the pool class.
> I suspect I know the answer to this (and that it isn't what I'm hoping for), but if I run the whole package under Wing, then sit back and wait for the exception, will Wing capture the state of ALL the variables, both in the main process and in the subprocesses?

No, you currently can only debug one process at a time (something I'd 
like to change eventually).  It would be possible to set up the process 
where the exception occurs to import wingdbstub and start debugging at 
that point in time, but I'm not sure if that will help with this problem 
given the long time frames.  You'ld pretty much have to have a dedicated 
copy of Wing running waiting for the failure.  This may be a case where 
added logging and dumping of program state on error will help more than 
a debugger.


Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list