summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--zkfacade/src/main/java/com/yahoo/vespa/curator/Lock.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/Lock.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/Lock.java
index 469b8d1355c..3e9c586f43c 100644
--- a/zkfacade/src/main/java/com/yahoo/vespa/curator/Lock.java
+++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/Lock.java
@@ -30,18 +30,21 @@ public class Lock implements Mutex {
private long nextSequenceNumber = 0;
private final Map<Long, Long> reentriesByThreadId = new HashMap<>();
private final Instant created = Instant.now();
+ private Curator curator;
private final InterProcessLock mutex;
private final String lockPath;
public Lock(String lockPath, Curator curator) {
this(lockPath, curator.createMutex(lockPath));
+ this.curator = curator;
}
/** Public for testing only */
public Lock(String lockPath, InterProcessLock mutex) {
this.lockPath = lockPath;
this.mutex = mutex;
+ this.curator = null;
}
/** Take the lock with the given timeout. This may be called multiple times from the same thread - each matched by a close */
@@ -85,8 +88,9 @@ public class Lock implements Mutex {
reentriesByThreadIdCopy = Map.copyOf(reentriesByThreadId);
}
- String debug = "thread " + threadId + " " + lockPath + "@" + created + " 0x" +
- Integer.toHexString(System.identityHashCode(this)) + " #" + sequenceNumber +
+ String debug = "thread " + threadId + " Lock 0x" + Integer.toHexString(System.identityHashCode(this)) +
+ "@" + created + " Curator 0x" + Integer.toHexString(System.identityHashCode(curator)) +
+ " lock " + lockPath + " #" + sequenceNumber +
", reentries by thread ID = " + reentriesByThreadIdCopy;
consumer.accept(debug);
}