ARTEMIS-2567 redundant lock on server.lock file

This commit is contained in:
Justin Bertram 2020-01-06 14:45:44 -06:00 committed by Howard Gao
parent 4005a63d9e
commit 59e7db8925
1 changed files with 1 additions and 8 deletions

View File

@ -108,14 +108,7 @@ public class FileLockNodeManager extends NodeManager {
protected synchronized void setUpServerLockFile() throws IOException {
super.setUpServerLockFile();
if (lockChannels[0] == null || !lockChannels[0].isOpen()) {
File fileLock = newFile(NodeManager.SERVER_LOCK_NAME);
if (!fileLock.exists()) {
fileLock.createNewFile();
}
RandomAccessFile randomFileLock = new RandomAccessFile(fileLock, "rw");
lockChannels[0] = randomFileLock.getChannel();
}
lockChannels[0] = channel;
for (int i = 1; i < 3; i++) {
if (lockChannels[i] != null && lockChannels[i].isOpen()) {