You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Matt Pavlovich (Jira)" <ji...@apache.org> on 2023/11/02 04:49:00 UTC
[jira] [Updated] (AMQ-9376) Fix concurrent modification in ActiveMQServiceFactory
[ https://issues.apache.org/jira/browse/AMQ-9376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Pavlovich updated AMQ-9376:
--------------------------------
Summary: Fix concurrent modification in ActiveMQServiceFactory (was: Fix thread safety issue in )
> Fix concurrent modification in ActiveMQServiceFactory
> -----------------------------------------------------
>
> Key: AMQ-9376
> URL: https://issues.apache.org/jira/browse/AMQ-9376
> Project: ActiveMQ
> Issue Type: Bug
> Reporter: Matt Pavlovich
> Priority: Major
>
> Need a class instance level lock around the broker map
> Calling .destroy() loops over a map which calls deleted.. which fails when there is more than one bundle and the bundle is shutdown first (not a service remove via .cfg delete).
> #1. OSGi calls..
> {noformat}
> synchronized public void destroy() {
> for (String broker : brokers.keySet()) {
> deleted(broker);
> }
> }
> {noformat}
> #2. Which blows up here..
> {noformat}
> @Override
> synchronized public void deleted(String pid) {
> ServiceRegistration<BrokerService> reg = brokerRegs.remove(pid);
> if (reg != null) {
> reg.unregister();
> }
> BrokerService broker = brokers.remove(pid);
> if (broker != null) {
> stop(pid, broker);
> }
> }
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)