From 4ae7d3ad117ccf635cf5616a3bfe041400b9e0ea Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Fri, 16 Oct 2020 15:40:28 +0200 Subject: [PATCH] Improve the registry lock failure error message --- .../main/java/org/jboss/fuse/mvnd/common/DaemonRegistry.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/org/jboss/fuse/mvnd/common/DaemonRegistry.java b/common/src/main/java/org/jboss/fuse/mvnd/common/DaemonRegistry.java index dfc6c99c..23d6ec4f 100644 --- a/common/src/main/java/org/jboss/fuse/mvnd/common/DaemonRegistry.java +++ b/common/src/main/java/org/jboss/fuse/mvnd/common/DaemonRegistry.java @@ -224,7 +224,7 @@ public class DaemonRegistry implements AutoCloseable { } private void doUpdate(Runnable updater) { - if (!Files.isReadable(getRegistryFile())) { + if (!Files.isReadable(registryFile)) { throw new DaemonException("Registry became unaccessible"); } try { @@ -350,7 +350,8 @@ public class DaemonRegistry implements AutoCloseable { if (currentThread().isInterrupted()) throw new InterruptedException(); else - throw new IllegalStateException("Failed to acquire lock after " + BUSY_LOCK_LIMIT / 1e9 + " seconds."); + throw new IllegalStateException("Failed to lock offset " + offset + " of " + registryFile + " within " + + BUSY_LOCK_LIMIT / 1e9 + " seconds."); } public void unlockLong(long offset) throws IllegalMonitorStateException {