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

tabish 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 9bb63b656f ARTEMIS-5042 don't throw Exception when clearing 
cluster-connection bindings
9bb63b656f is described below

commit 9bb63b656f64071f92fb7b7846e6d6c274931f64
Author: Justin Bertram <[email protected]>
AuthorDate: Fri Sep 20 15:24:57 2024 -0500

    ARTEMIS-5042 don't throw Exception when clearing cluster-connection bindings
    
    Throwing an exception when clearing the bindings when a
    cluster-connection is closed short-circuits the clearing (and closing)
    process. This commit fixes that by simply logging the failure to clear
    and continues on.
    
    No new tests are added with this commit. It relies on existing tests.
---
 .../apache/activemq/artemis/core/server/ActiveMQServerLogger.java | 3 +++
 .../artemis/core/server/cluster/impl/ClusterConnectionImpl.java   | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
index 5a88f63244..f48a62bf9d 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
@@ -1621,4 +1621,7 @@ public interface ActiveMQServerLogger {
 
    @LogMessage(id = 224139, value = "Failed to stop bridge: {}", level = 
LogMessage.Level.ERROR)
    void errorStoppingBridge(String bridgeName, Exception e);
+
+   @LogMessage(id = 224140, value = "Clearing bindings on cluster-connection 
{} failed to remove binding {}: {}", level = LogMessage.Level.WARN)
+   void clusterConnectionFailedToRemoveBindingOnClear(String 
clusterConnection, String binding, String exceptionMessage);
 }
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
index 2b0f2b2d75..2f8b7b72a0 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
@@ -1245,10 +1245,14 @@ public final class ClusterConnectionImpl implements 
ClusterConnection, AfterConn
          server.getGroupingHandler().sendProposalResponse(response, hops + 1);
       }
 
-      private synchronized void clearBindings() throws Exception {
+      private synchronized void clearBindings() {
          logger.debug("{} clearing bindings", ClusterConnectionImpl.this);
          for (RemoteQueueBinding binding : new HashSet<>(bindings.values())) {
-            removeBinding(binding.getClusterName());
+            try {
+               removeBinding(binding.getClusterName());
+            } catch (Exception e) {
+               
ActiveMQServerLogger.LOGGER.clusterConnectionFailedToRemoveBindingOnClear(getName().toString(),
 binding.getClusterName().toString(), e.getMessage());
+            }
          }
       }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to