clebertsuconic commented on a change in pull request #2782: ARTEMIS-2441
Separate Lock Files
URL: https://github.com/apache/activemq-artemis/pull/2782#discussion_r310603307
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
##########
@@ -82,6 +86,36 @@ public synchronized void start() throws Exception {
super.start();
}
+ @Override
+ protected synchronized void setUpServerLockFile() throws IOException {
+ super.setUpServerLockFile();
+
+ for (int i = 0; i < 3; i++) {
+ if (lockChannels[i] != null && lockChannels[i].isOpen()) {
+ continue;
+ }
+ File fileLock = newFile("serverlock." + i);
+ if (!fileLock.exists()) {
+ fileLock.createNewFile();
+ }
+ RandomAccessFile randomFileLock = new RandomAccessFile(fileLock,
"rw");
+ lockChannels[i] = randomFileLock.getChannel();
+ }
+ }
+
+ @Override
+ public synchronized void stop() throws Exception {
+ for (FileChannel channel : lockChannels) {
+ try {
+ channel.close();
+ } catch (Throwable e) {
+
Review comment:
hmmm... I should have logged it here. (reviewing my own PR)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services