add logging when trying to obtain node lock

This commit is contained in:
kimchy 2011-03-29 21:34:15 +02:00
parent 0069d5a75d
commit 9bb0bcf4e3

View File

@ -62,6 +62,7 @@ public class NodeEnvironment extends AbstractComponent {
if (!dir.exists()) { if (!dir.exists()) {
dir.mkdirs(); dir.mkdirs();
} }
logger.trace("obtaining node lock on {} ...", dir.getAbsolutePath());
try { try {
NativeFSLockFactory lockFactory = new NativeFSLockFactory(dir); NativeFSLockFactory lockFactory = new NativeFSLockFactory(dir);
Lock tmpLock = lockFactory.makeLock("node.lock"); Lock tmpLock = lockFactory.makeLock("node.lock");
@ -70,8 +71,11 @@ public class NodeEnvironment extends AbstractComponent {
lock = tmpLock; lock = tmpLock;
localNodeId = i; localNodeId = i;
break; break;
} else {
logger.trace("failed to obtain node lock on {}", dir.getAbsolutePath());
} }
} catch (IOException e) { } catch (IOException e) {
logger.trace("failed to obtain node lock on {}", e, dir.getAbsolutePath());
lastException = e; lastException = e;
} }
} }