forked from openstack-infra/nodepool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mutex access to local lock attributes
When we lock or unlock requests or nodes, we set the .lock attribute of the request/node to the ZK lock object or None respectively. If two threads are racing an unlock and lock, we can have the following sequence: 1: unlock request in ZK 2: lock request in ZK 2: set request.lock to ZK lock object 1: set request.lock object to None If this happens, thread 2 will not be able to unlock the request and it will stay locked permanently. To correct this, set a local mutex around these operations so that they can not be sequenced as above. Change-Id: Ic52dc0202bf629462d774406b08b7dee01396dd8
- Loading branch information
Showing
1 changed file
with
43 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters