[Buildbot-devel] p4poller: SIGCHLD handler is not installed

Scott Lamb slamb at slamb.org
Mon Apr 10 22:01:31 UTC 2006


Using Twisted 2.2.0 + buildbot 0.7.2 + in-progress 2wire p4 patches,  
I get this message:

     twistd.log.1:2006/04/07 16:52 PDT [-] spawnProcess called, but  
the SIGCHLD handler is not installed. This probably means you have  
not yet called reactor.run, or called reactor.run 
(installSignalHandler=0). You will probably never see this process  
finish, and it may become a zombie process.

on first call to getProcessOutput from p4poller.P4Source. And indeed,  
_process_changes never seems to be called.

I added a few log.msg()s and found this:

     2006/04/10 14:38 PDT [-] Starting application
     ...
     2006/04/10 14:38 PDT [-] P4Poller
     2006/04/10 14:38 PDT [-] checkp4
     2006/04/10 14:38 PDT [-] spawnProcess called, but the SIGCHLD  
handler is not installed. This probably means you have not yet called  
reactor.
     run, or called reactor.run(installSignalHandler=0). You will  
probably never see this process finish, and it may become a zombie  
process.
     ...
     2006/04/10 14:38 PDT [-] Calling runReactorWithLogging
     2006/04/10 14:38 PDT [-] Calling reactor.run

...so indeed it's the former case. It's calling spawnProcess before  
starting the reactor.

Looks like the call tree is this (skipping some frames):

- twisted.scripts.twistd.runApp
-- twisted.scripts.twistd.startApplication
--- buildbot.changes.p4poller.P4Source.startService
---- twisted.internet.task.LoopingCall.start(..., now=True)
----- LoopingCall.__call__
------ P4Source._get_changes
------- twisted.internet.utils.getProcessOutput
-- twisted.application.app.runReactorWithLogging

I can work around this problem by sticking a reactor.callLater in  
P4Source.startService to make it wait for the reactor to start before  
looping. Do you think this is the best solution? I kind of wonder if  
buildbot shouldn't be doing so much stuff before the reactor starts  
up. Has this problem come up anywhere else?

-- 
Scott Lamb <http://www.slamb.org/>




More information about the devel mailing list