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
1 changed files with 4 additions and 0 deletions

View File

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