Add extra safety belt when reusing a node

When reusing a node we lock it but don't check if the state is still
ready. There are probably few to no possibilities how this can happen.
But it's better to guarantee this condition than to think that this
should be ok.

Change-Id: I365de6accb28b538dae5ff1dfb6c4a9966e50b01
This commit is contained in:
Tobias Henkel 2018-11-08 10:03:02 +01:00
parent b6a3e319e7
commit e4f245eb13
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2

View File

@ -437,6 +437,11 @@ class NodeRequestHandler(NodeRequestHandlerNotifications,
# It's already locked so skip it.
continue
else:
# Add an extra safety check that the node is still
# ready.
if node.state != zk.READY:
self.zk.unlockNode(node)
continue
if self.paused:
self.log.debug("Unpaused request %s", self.request)
self.paused = False