diff --git a/nodepool/launcher.py b/nodepool/launcher.py index 5201bf807..0a2bb1025 100644 --- a/nodepool/launcher.py +++ b/nodepool/launcher.py @@ -156,10 +156,6 @@ class PoolWorker(threading.Thread, stats.StatsReporter): req_count + 1, len(requests), elapsed) return False - req = self.zk.getNodeRequest(req.id) - if not req: - continue - # Only interested in unhandled requests if req.state != zk.REQUESTED: continue @@ -263,6 +259,11 @@ class PoolWorker(threading.Thread, stats.StatsReporter): log.debug("Request is in state %s", req.state) continue + # Skip it if we've already declined + if self.launcher_id in req.declined_by: + log.debug("Request is already declined") + continue + if not reasons_to_decline: # Got a lock, so assign it log.info("Assigning node request %s" % req)