Add missing request unlock

Because we now iterate over cached requests, when we decide that
we should lock a request to attempt to handle or decline it, we
double check the status of the request after locking it.  The act
of locking the request refreshes the data from ZK, so at this point
we are certain that the data are up to date.

In the case where, after locking and refreshing, we double checked
that we had not already declined the request, we are missing an
instruction to unlock the request.  This can leave a request
perpetually locked.

This change adds the missing unlock.

Change-Id: Ifcf52bbca03329a8ca7015412f9aaf795c5ae7c0
This commit is contained in:
James E. Blair 2023-05-01 10:34:14 -07:00
parent 58b24d2203
commit 3e8dce8873

View File

@ -268,6 +268,7 @@ class PoolWorker(threading.Thread, stats.StatsReporter):
# Skip it if we've already declined
if self.launcher_id in req.declined_by:
self.zk.unlockNodeRequest(req)
log.debug("Request is already declined")
continue