From 8eb411fcc961f7bef09d5e7eafb6f4cdbacf8cd6 Mon Sep 17 00:00:00 2001 From: Ion Alberdi Date: Thu, 16 Jul 2015 12:58:39 +0200 Subject: [PATCH] service: clusteredService activityPoll does not wait for its stop 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. --- master/buildbot/util/service.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/master/buildbot/util/service.py b/master/buildbot/util/service.py index aa905581f19..7c587676e22 100644 --- a/master/buildbot/util/service.py +++ b/master/buildbot/util/service.py @@ -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