You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2024/08/30 15:39:08 UTC

(activemq-artemis) branch main updated: ARTEMIS-4972 Use Lock in start() for Binding Variables

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 f9b912baf0 ARTEMIS-4972 Use Lock in start() for Binding Variables
f9b912baf0 is described below

commit f9b912baf02eb2dad76e3ab4dfb00f3eeeb8aff7
Author: Yashashree Chopada <ya...@gmail.com>
AuthorDate: Thu Aug 22 00:53:41 2024 +0530

    ARTEMIS-4972 Use Lock in start() for Binding Variables
---
 .../artemis/core/server/group/impl/LocalGroupingHandler.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/LocalGroupingHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/LocalGroupingHandler.java
index d34f587dd8..6fbdbbb508 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/LocalGroupingHandler.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/LocalGroupingHandler.java
@@ -322,9 +322,15 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract {
       if (started)
          return;
 
-      if (expectedBindings == null) {
-         // just in case the component is restarted
-         expectedBindings = new LinkedList<>();
+      lock.lock();
+
+      try {
+         if (expectedBindings == null) {
+            // just in case the component is restarted
+            expectedBindings = new LinkedList<>();
+         }
+      } finally {
+         lock.unlock();
       }
 
       if (reaperPeriod > 0 && groupTimeout > 0) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@activemq.apache.org
For additional commands, e-mail: commits-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact