The old logging statements in lockutils made for some confusing log
entries where it would appear a given lock was acquired multiple
times by different threads at the same time. See referenced bug
for details.
In order to alleviate that confusion, this change does a few things:
1) Adds an explicit "acquired" message inside the lock so it is
clear when the lock was actually acquired.
2) Moves the release message inside the semaphore so there's no
chance of it being logged out of order.
3) Removes the "Got semaphore" message and splits it into two
separate messages depending on whether the semaphore was found
in the weakref dictionary. Making it clear which code path
was followed should help with future debugging.
This is the Nova port of oslo-incubator change
If863c9d3896bc786f3c9c46196ebb0766e57d863
Reviewed: https:/ /review. openstack. org/120934 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=cad742d9525 cb4d0a630d4ca4c 15037ea29e811e
Committed: https:/
Submitter: Jenkins
Branch: master
commit cad742d9525cb4d 0a630d4ca4c1503 7ea29e811e
Author: Davanum Srinivas <email address hidden>
Date: Thu Sep 11 19:00:54 2014 -0400
Clarify logging in lockutils
The old logging statements in lockutils made for some confusing log
entries where it would appear a given lock was acquired multiple
times by different threads at the same time. See referenced bug
for details.
In order to alleviate that confusion, this change does a few things:
1) Adds an explicit "acquired" message inside the lock so it is
clear when the lock was actually acquired.
2) Moves the release message inside the semaphore so there's no
chance of it being logged out of order.
3) Removes the "Got semaphore" message and splits it into two
separate messages depending on whether the semaphore was found
in the weakref dictionary. Making it clear which code path
was followed should help with future debugging.
This is the Nova port of oslo-incubator change 6bc786f3c9c4619 6ebb0766e57d863
If863c9d389
Change-Id: I530befb42a963a 40e7d5bf8d4d81f c097e1cb309
Partial-Bug: #1367941