diff options
author | Håkon Hallingstad <hakon@yahooinc.com> | 2022-04-27 09:56:13 +0200 |
---|---|---|
committer | Håkon Hallingstad <hakon@yahooinc.com> | 2022-04-27 09:56:13 +0200 |
commit | 48de88a7d7ad21261e3804c1bdf4ab20e50e150d (patch) | |
tree | f4159187af3c18e15d65a397278b4b451f97f0a1 /zkfacade | |
parent | dc66caea51baa3a06381784fcafb1cce9ff6384d (diff) |
Also identify curator
Diffstat (limited to 'zkfacade')
-rw-r--r-- | zkfacade/src/main/java/com/yahoo/vespa/curator/Lock.java | 8 |
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); } |