This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch activemq-5.18.x
in repository https://gitbox.apache.org/repos/asf/activemq.git
The following commit(s) were added to refs/heads/activemq-5.18.x by this push:
new f9e28b916 [AMQ-9376] Fix ConcurrentModificationException during a
destroy()
f9e28b916 is described below
commit f9e28b916a5e8b3ad78672d538c08a2cb1f9304a
Author: Matt Pavlovich <[email protected]>
AuthorDate: Tue Nov 7 08:12:46 2023 -0600
[AMQ-9376] Fix ConcurrentModificationException during a destroy()
(cherry picked from commit 19696254dddf169fa62d502a53fa0351bad3d080)
---
.../main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/activemq-osgi/src/main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java
b/activemq-osgi/src/main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java
index 066c05d01..343e51256 100644
---
a/activemq-osgi/src/main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java
+++
b/activemq-osgi/src/main/java/org/apache/activemq/osgi/ActiveMQServiceFactory.java
@@ -22,6 +22,7 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.spring.SpringBrokerContext;
@@ -182,7 +183,8 @@ public class ActiveMQServiceFactory implements
ManagedServiceFactory {
}
synchronized public void destroy() {
- for (String broker : brokers.keySet()) {
+ Set<String> tmpBrokersSet = brokers.keySet();
+ for (String broker : tmpBrokersSet) {
deleted(broker);
}
}