This closes #2909
This commit is contained in:
commit
d2215aa7e3
|
@ -30,7 +30,7 @@ import org.apache.activemq.artemis.utils.UUIDGenerator;
|
|||
public abstract class NodeManager implements ActiveMQComponent {
|
||||
|
||||
protected static final byte FIRST_TIME_START = '0';
|
||||
private static final String SERVER_LOCK_NAME = "server.lock";
|
||||
public static final String SERVER_LOCK_NAME = "server.lock";
|
||||
private static final String ACCESS_MODE = "rw";
|
||||
|
||||
protected final boolean replicatedBackup;
|
||||
|
|
|
@ -108,7 +108,16 @@ public class FileLockNodeManager extends NodeManager {
|
|||
protected synchronized void setUpServerLockFile() throws IOException {
|
||||
super.setUpServerLockFile();
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
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();
|
||||
}
|
||||
|
||||
for (int i = 1; i < 3; i++) {
|
||||
if (lockChannels[i] != null && lockChannels[i].isOpen()) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue