jbertram commented on a change in pull request #2909: ARTEMIS-2567 restore 
locking semantics on server.lock when reading st…
URL: https://github.com/apache/activemq-artemis/pull/2909#discussion_r354472614
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
 ##########
 @@ -108,7 +108,16 @@ public synchronized void start() throws Exception {
    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();
 
 Review comment:
   If the `if` returns false then that means `lockChannels[0]` is not equal to 
`null` and it's open which means we don't need to create the file or get the 
channel. It's the same basic logic that was already in place. I didn't change 
the semantics on that part.

----------------------------------------------------------------
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

Reply via email to