12 Commits

Author SHA1 Message Date
Jenkins
afdc56d83a Merge "Cleanup and adding timing to lockutils logging" 2014-09-20 05:20:48 +00:00
Brian D. Elliott
103e60e9c0 Cleanup and adding timing to lockutils logging
* Cleanup lockutils logging by showing lock name and function in
same line.  The enables easier parsing of information related to lock
acquisition from logs.

* Logs time a thread spent waiting on locks, as well as time spent
holding locks.  This will make it easier to debug suboptimal locking.

Change-Id: Ic310d84eb1ed75cc1c21c3d7861b4a3927ebaf23
2014-09-18 13:27:11 +00:00
Joshua Harlow
6a0fb778c6 Break up the logging around the lockfile release/unlock
To be better able to identify when and where are file lock
breaks when release occurs it's useful to distingush the
different steps of release and independently log them as
unique steps.

Change-Id: I3b605994ca7673e5c97e73821d2ea777117f5f09
2014-09-16 14:24:10 -07:00
Joshua Harlow
a14a75f0a1 Always log the releasing, even under failure
Change-Id: Ic040d2cad5004caa8786793373fbd5baca54d32e
2014-09-12 09:03:53 -07:00
Ben Nemec
19e0feb5a1 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.

Change-Id: I0fbb473c60d48c9704597d9e3634402857861a66
Closes-Bug: 1367941
2014-09-11 20:00:18 +00:00
Jenkins
70dcb60796 Merge "Address some potential security issues in lockutils" 2014-09-03 12:58:22 +00:00
Jenkins
ddbce65897 Merge "Switch to oslo.i18n in our code" 2014-08-24 16:37:16 +00:00
Ben Nemec
60167d0b37 Address some potential security issues in lockutils
Adds a note to the lock_path help text explaining how to secure the
target directory.  Also opens lock files in append mode so there is
no possibility of overwriting a file due to a malicious symlink.

Change-Id: I77b72b20088fe66b573c23bd1fd98376c2b0f168
2014-08-22 17:21:24 +00:00
Ben Nemec
f1688a70f2 Use file locks by default again
After a lot of discussion[1], it was decided that this is the
safest way forward.  In the future we can investigate alternative
locking methods, probably as opt-ins so we don't break any
existing consumers of these locks.

[1] http://lists.openstack.org/pipermail/openstack-dev/2014-August/043090.html

Change-Id: I49ff98abc395d3263d55aeff26081b462a8a294e
Partial-Bug: 1327946
2014-08-22 17:13:25 +00:00
Yuriy Taraday
8a2ba06743 Switch to oslo.i18n in our code
Note that gettextutils are still indirectly used by fileutils (through log).

Change-Id: I4ea4830ed149aff87146a4b7392d7e48c6a7c793
2014-08-21 21:10:18 +04:00
Yuriy Taraday
1761de8f02 Make all tests pass 2014-08-07 22:27:31 +04:00
Yuriy Taraday
6fc3e6808b exported from oslo-incubator by graduate.sh 2014-08-07 22:26:50 +04:00