summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2018-11-30 16:28:02 -0800
committerTobias Henkel <tobias.henkel@bmw.de>2018-12-01 13:30:10 +0100
commit177e3c1f6f1e905dfb548729c70a84ced1656e30 (patch)
treec34dfdb75533ad483d2e2dd7568f7e99ec5c20dd
parentaab51a7570d8be71617f7fb1484106c1ae803ffd (diff)
Add more debug lines to request handler
So that we can see the new request processing flow better. Change-Id: I2c2d40b53a93cbf7632c657919d70ce1876e6dea
Notes
Notes (review): Code-Review+2: Tobias Henkel <tobias.henkel@bmw.de> Code-Review+2: Monty Taylor <mordred@inaugust.com> Workflow+1: Monty Taylor <mordred@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sat, 01 Dec 2018 14:20:19 +0000 Reviewed-on: https://review.openstack.org/621321 Project: openstack-infra/nodepool Branch: refs/heads/master
-rwxr-xr-xnodepool/launcher.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/nodepool/launcher.py b/nodepool/launcher.py
index 883a962..b6400db 100755
--- a/nodepool/launcher.py
+++ b/nodepool/launcher.py
@@ -180,7 +180,9 @@ class PoolWorker(threading.Thread, stats.StatsReporter):
180 if not self.running: 180 if not self.running:
181 return True 181 return True
182 182
183 self.log.debug("Considering request %s", req.id)
183 if self.paused_handler: 184 if self.paused_handler:
185 self.log.debug("Handler is now paused")
184 return True 186 return True
185 187
186 # Get active threads for all pools for this provider 188 # Get active threads for all pools for this provider
@@ -199,24 +201,29 @@ class PoolWorker(threading.Thread, stats.StatsReporter):
199 201
200 req = self.zk.getNodeRequest(req.id) 202 req = self.zk.getNodeRequest(req.id)
201 if not req: 203 if not req:
204 self.log.debug("Request %s no longer exists", req.id)
202 continue 205 continue
203 206
204 # Only interested in unhandled requests 207 # Only interested in unhandled requests
205 if req.state != zk.REQUESTED: 208 if req.state != zk.REQUESTED:
209 self.log.debug("Request %s is in state %s", req.id, req.state)
206 continue 210 continue
207 211
208 # Skip it if we've already declined 212 # Skip it if we've already declined
209 if self.launcher_id in req.declined_by: 213 if self.launcher_id in req.declined_by:
214 self.log.debug("Request %s was already declined", req.id)
210 continue 215 continue
211 216
212 try: 217 try:
213 self.zk.lockNodeRequest(req, blocking=False) 218 self.zk.lockNodeRequest(req, blocking=False)
214 except exceptions.ZKLockException: 219 except exceptions.ZKLockException:
220 self.log.debug("Request %s is locked by someone else", req.id)
215 continue 221 continue
216 222
217 # Make sure the state didn't change on us after getting the lock 223 # Make sure the state didn't change on us after getting the lock
218 if req.state != zk.REQUESTED: 224 if req.state != zk.REQUESTED:
219 self.zk.unlockNodeRequest(req) 225 self.zk.unlockNodeRequest(req)
226 self.log.debug("Request %s is in state %s", req.id, req.state)
220 continue 227 continue
221 228
222 # Got a lock, so assign it 229 # Got a lock, so assign it