Skip to content

Commit

Permalink
service: clusteredService activityPoll does not wait for its stop
Browse files Browse the repository at this point in the history
the previous version had a bug as the callback (_activityPoll)
of the object
_activityPollCall = task.LoopingCall(_activityPoll)

waited the activityPollCall to stop during its execution
thus creating a deadlock.

This commit just say the activityPollCall to stop
during the method, and exits without waiting for its end.
  • Loading branch information
Ion Alberdi committed Jul 24, 2015
1 parent 3e6497c commit 8eb411f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion master/buildbot/util/service.py
Expand Up @@ -309,7 +309,13 @@ def _activityPoll(self):
# this service is half-active, and noted as such in the db..
log.err(_why='WARNING: ClusteredService(%s) is only partially active' % self.name)
finally:
yield self._stopActivityPolling()
# cannot wait for its deactivation
# with yield self._stopActivityPolling
# as we're currently executing the
# _activityPollCall callback
# we just call it without waiting its stop
# (that may open race conditions)
self._stopActivityPolling()
self._startServiceDeferred.callback(None)
except Exception:
# don't pass exceptions into LoopingCall, which can cause it to fail
Expand Down

0 comments on commit 8eb411f

Please sign in to comment.