Skip to content

Commit

Permalink
Merge pull request #1822 from jaredgrubb/jgrubb-interrupt
Browse files Browse the repository at this point in the history
Fix #3248: BuildStep: fix up interrupt logic
  • Loading branch information
Mikhail Sobolev committed Oct 6, 2015
2 parents 4f9f915 + 9ee4dbc commit 0c135f2
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions master/buildbot/process/buildstep.py
Expand Up @@ -389,12 +389,25 @@ def start(self):
raise NotImplementedError("your subclass must implement run()")

def interrupt(self, reason):
# TODO: consider adding an INTERRUPTED or STOPPED status to use
# instead of FAILURE, might make the text a bit more clear.
# 'reason' can be a Failure, or text
self.stopped = True
if self._acquiringLock:
lock, access, d = self._acquiringLock
lock.stopWaitingUntilAvailable(self, access, d)
d.callback(None)

if self._step_status.isWaitingForLocks():
self.addCompleteLog(
'interrupt while waiting for locks', str(reason))
else:
self.addCompleteLog('interrupt', str(reason))

if self.cmd:
d = self.cmd.interrupt(reason)
d.addErrback(log.err, 'while interrupting command')

def releaseLocks(self):
log.msg("releaseLocks(%s): %s" % (self, self.locks))
for lock, access in self.locks:
Expand Down Expand Up @@ -683,21 +696,6 @@ def setupLogfiles(self, cmd, logfiles):
# and tell the RemoteCommand to feed it
cmd.useLog(newlog, True)

def interrupt(self, reason):
# TODO: consider adding an INTERRUPTED or STOPPED status to use
# instead of FAILURE, might make the text a bit more clear.
# 'reason' can be a Failure, or text
BuildStep.interrupt(self, reason)
if self._step_status.isWaitingForLocks():
self.addCompleteLog(
'interrupt while waiting for locks', str(reason))
else:
self.addCompleteLog('interrupt', str(reason))

if self.cmd:
d = self.cmd.interrupt(reason)
d.addErrback(log.err, 'while interrupting command')

def checkDisconnect(self, f):
# this is now handled by self.failed
log.msg("WARNING: step %s uses deprecated checkDisconnect method")
Expand Down

0 comments on commit 0c135f2

Please sign in to comment.