This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new ec52682  ARTEMIS-3145 ensure lock validity before releasing
     new 1f24bef  This closes #3817
ec52682 is described below

commit ec5268269752740f33dadf4c6210cac1339dcb63
Author: Justin Bertram <[email protected]>
AuthorDate: Tue Oct 26 10:29:53 2021 -0500

    ARTEMIS-3145 ensure lock validity before releasing
---
 .../apache/activemq/artemis/core/server/impl/FileLockNodeManager.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
index 67f469c..7541149 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
@@ -355,7 +355,7 @@ public class FileLockNodeManager extends 
FileBasedNodeManager {
                result = bb.get(0);
             }
          } finally {
-            if (lock != null) {
+            if (lock != null && lock.isValid()) {
                lock.release();
             }
          }

Reply via email to