Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #164 from christiankjaer/slave-complete-previous-step
Browse files Browse the repository at this point in the history
Let's test this on staging, we need to test on all lin, win, mac agents
  • Loading branch information
mariangemarcano committed Jun 8, 2016
2 parents 3b98d7f + 1f945ea commit d456726
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions slave/buildslave/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ class SlaveBuilder(pb.Referenceable, service.Service):
# when the step is started
remoteStep = None

# .prevStep is a ref to the previous BuildStep object, and is set
# when a step if finished. This is to be able to notify the master
# if it missed a completedStep during an interrupt.
prevStep = None

def __init__(self, name):
#service.Service.__init__(self) # Service has no __init__ method
self.setName(name)
Expand Down Expand Up @@ -151,6 +156,11 @@ def remote_interruptCommand(self, stepId, why):
# TODO: just log it, a race could result in their interrupting a
# command that wasn't actually running
log.msg(" .. but none was running")
# Tell the master that the previous step is
# completed as well.
d = self.prevStep.callRemote("complete", None)
d.addCallback(self.ackComplete)
d.addErrback(self._ackFailed, "sendComplete")
return
self.command.doInterrupt()

Expand Down Expand Up @@ -221,6 +231,7 @@ def commandComplete(self, failure):
d = self.remoteStep.callRemote("complete", failure)
d.addCallback(self.ackComplete)
d.addErrback(self._ackFailed, "sendComplete")
self.prevStep = self.remoteStep
self.remoteStep = None


Expand Down

0 comments on commit d456726

Please sign in to comment.