summaryrefslogtreecommitdiffstats
path: root/src/test/cls_lock
diff options
context:
space:
mode:
authorJ. Eric Ivancich <ivancich@redhat.com>2019-02-01 23:57:31 +0100
committerJ. Eric Ivancich <ivancich@redhat.com>2019-02-04 20:45:04 +0100
commitaf5c1ed2c0d4687417ce14d342335fa97718f46c (patch)
tree05f54cf9cb7fd88236b655b8424cc27b44d2ccc5 /src/test/cls_lock
parentMerge PR #25703 into master (diff)
downloadceph-af5c1ed2c0d4687417ce14d342335fa97718f46c.tar.xz
ceph-af5c1ed2c0d4687417ce14d342335fa97718f46c.zip
rgw: when exclusive lock fails due existing lock, log add'l info
This is being added to better understand lock-contention issues in running systems. Here are two sample log output lines: 2019-02-04 14:22:31.228 7f06abb59700 20 <cls> /somedir/ceph/src/cls/lock/cls_lock.cc:221: could not exclusive-lock object, already locked by [{name:client.4139, addr:v1:127.0.0.1:0/2034495868, exp:2019-02-04 14:24:31.0.22272s}] 2019-02-04 14:22:37.219 7f06abb59700 20 <cls> /somedir/ceph/src/cls/lock/cls_lock.cc:221: could not exclusive-lock object, already locked by [{name:client.4147, addr:v1:127.0.0.1:0/141966515, exp:never}] Fixes: http://tracker.ceph.com/issues/38171 Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
Diffstat (limited to 'src/test/cls_lock')
-rw-r--r--src/test/cls_lock/test_cls_lock.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/cls_lock/test_cls_lock.cc b/src/test/cls_lock/test_cls_lock.cc
index c9bc2dd4b89..3ecd20ccfdb 100644
--- a/src/test/cls_lock/test_cls_lock.cc
+++ b/src/test/cls_lock/test_cls_lock.cc
@@ -85,6 +85,9 @@ TEST(ClsLock, TestMultiLocking) {
ASSERT_EQ(0, ioctx.write(oid, bl, bl.length(), 0));
Lock l(lock_name);
+ // we set the duration, so the log output contains a locker with a
+ // non-zero expiration time
+ l.set_duration(utime_t(120, 0));
/* test lock object */