mozilla-services/circus — pull request #606 by scottkmaxwell (2013-10-25 18:42:44+00:00)
Title: Include wid in stats

Two minor changes here. Simple change is to include 'wid' in stats. This is very useful since the wid is the only real unique-per-process ID we can pass on the command line. In my case, I use the wid to give uwsgi unique files for stats sockets and touch reload:

[watcher:web]
cmd = /Users/scottmax/Source/service-framework/env/bin/uwsgi --ini uwsgi-live.ini --socket fd://$(circus.sockets.web) --stats /Users/scottmax/Source/service-framework/Common/conf/sock/web-stats.$(circus.wid) --touch-chain-reload /Users/scottmax/Source/service-framework/Common/conf/web-restart.$(circus.wid) --py-tracebacker /Users/scottmax/Source/service-framework/Common/conf/sock/web-traceback.$(circus.wid)

But then to actually perform the reload or access the stats, I need to know the current wid for the process.

The other change is really minor, even though the commit looks really involved. I had to change _patch.py to detect if you are running a debugger, and skip the patch if you are. The set_trace commands screw up your ability to debug with pydevd.