Reviewed: https://review.openstack.org/221100 Committed: https://git.openstack.org/cgit/openstack/pylockfile/commit/?id=333cbd39a50e5908136f9270a354ff5d1f6b6956 Submitter: Jenkins Branch: master
commit 333cbd39a50e5908136f9270a354ff5d1f6b6956 Author: Davanum Srinivas <email address hidden> Date: Mon Sep 7 16:05:56 2015 -0400
lockfile.acquire doesn't accept a timeout of 0
Docs indicates that lock.acquire(timeout=0) would not block, but it does (for linklockfile) because 0 is not truthy, and the line:
timeout = timeout is not None and timeout or self.timeout
when timeout is 0 causes it to default to self.timeout, which by default is None.
So rewrite the condition better to take into account that timeout may be set to 0.
Closes-Bug: #1468124 Closes-Bug: #1419127 Change-Id: Idf0d00977e79661e1eafd695d6e148e5f27e1840
Reviewed: https:/ /review. openstack. org/221100 /git.openstack. org/cgit/ openstack/ pylockfile/ commit/ ?id=333cbd39a50 e5908136f9270a3 54ff5d1f6b6956
Committed: https:/
Submitter: Jenkins
Branch: master
commit 333cbd39a50e590 8136f9270a354ff 5d1f6b6956
Author: Davanum Srinivas <email address hidden>
Date: Mon Sep 7 16:05:56 2015 -0400
lockfile. acquire doesn't accept a timeout of 0
Docs indicates that lock.acquire( timeout= 0) would not block, but it
does (for linklockfile) because 0 is not truthy, and the line:
timeout = timeout is not None and timeout or self.timeout
when timeout is 0 causes it to default to self.timeout, which by default is None.
So rewrite the condition better to take into account that timeout may
be set to 0.
Closes-Bug: #1468124 1e1eafd695d6e14 8e5f27e1840
Closes-Bug: #1419127
Change-Id: Idf0d00977e7966