michaelandrepearce commented on a change in pull request #2287: ARTEMIS-2069 
Backup doesn't activate after shared store is reconnected
URL: https://github.com/apache/activemq-artemis/pull/2287#discussion_r250605719
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
 ##########
 @@ -299,44 +301,52 @@ protected FileLock tryLock(final long lockPos) throws 
IOException {
 
    protected FileLock lock(final long lockPosition) throws Exception {
       long start = System.currentTimeMillis();
+      boolean isRecurringFailure = false;
 
       while (!interrupted) {
-         FileLock lock = tryLock(lockPosition);
-
-         if (lock == null) {
-            try {
-               Thread.sleep(500);
-            } catch (InterruptedException e) {
-               return null;
+         try {
+            FileLock lock = tryLock(lockPosition);
+            isRecurringFailure = false;
+
+            if (lock == null) {
+               try {
+                  Thread.sleep(500);
+               } catch (InterruptedException e) {
+                  return null;
+               }
+
+               if (lockAcquisitionTimeout != -1 && (System.currentTimeMillis() 
- start) > lockAcquisitionTimeout) {
+                  throw new Exception("timed out waiting for lock");
 
 Review comment:
   Little bit too generic, this exception

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to