[Buildbot] #3512: [windows] pid file missing

Buildbot trac trac at buildbot.net
Tue May 10 07:27:52 UTC 2016

#3512: [windows] pid file missing
Reporter:  xonqnopp          |       Owner:
    Type:  defect            |      Status:  new
Priority:  patches-accepted  |   Milestone:  undecided
 Version:  0.8.12            |  Resolution:
Keywords:  windows pid       |

Comment (by xonqnopp):

 First here is my code in `master.cfg`:

 ## We need to trick twistd as it does not do what it is supposed to:
 if not os.path.exists("twistd.pid"):
     with open("twistd.pid", "w") as pidfile:
     realpid = os.getpid()
     filepid = 0
     with open("twistd.pid", "r") as pidfile:
         filepid = int(pidfile.read())
     if filepid == 0 or filepid != realpid:
         with open("twistd.pid", "w") as pidfile:

 When running buildbot manually, it works well. The problem is that the PID
 file is never deleted... The only danger is if you execute:

 buildbot start
 buildbot stop
 buildbot stop

 as it would try to kill the process having the PID stored in the file. In
 the best case, there is no process with this PID and it issues an error.
 In the worst case, you would kill another random process...

 I did not try the workaround with buildbot running as a windows service,
 since I cannot do this on my computer and the only one we have configured
 so is not to be broken :-S

 It also does not work for the slaves because the workaround is in the
 `master.cfg` file...

Ticket URL: <http://trac.buildbot.net/ticket/3512#comment:4>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation

More information about the bugs mailing list