Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-8157

Artemis fails on ConcurrentModificationException if system properties change during start

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.1.0.DR11
    • 7.1.0.DR10
    • ActiveMQ
    • None
    • Regression

      EAP 7.1.0.DR10 fails to start due to java.util.ConcurrentModificationException if system properties are changed during boot.

      Customer impact: Sometimes server fails to boot if system properties are changes during boot time.

      Logged exception is:

      13:06:58,899 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 71) MSC000001: Failed to start service jboss.messaging-activemq.default.jms.manager: org.jboss.msc.service.StartException in service jboss.messaging-activemq.default.jms.manager: WFLYMSGAMQ0033: Failed to start service
      	at org.wildfly.extension.messaging.activemq.jms.JMSService.doStart(JMSService.java:203)
      	at org.wildfly.extension.messaging.activemq.jms.JMSService.access$000(JMSService.java:63)
      	at org.wildfly.extension.messaging.activemq.jms.JMSService$1.run(JMSService.java:97)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_71]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_71]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_71]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_71]
      	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_71]
      	at org.jboss.threads.JBossThread.run(JBossThread.java:320) [jboss-threads-2.2.1.Final-redhat-1.jar:2.2.1.Final-redhat-1]
      Caused by: java.util.ConcurrentModificationException
      	at java.util.Hashtable$Enumerator.next(Hashtable.java:1367) [rt.jar:1.8.0_71]
      	at org.apache.activemq.artemis.core.config.impl.ConfigurationImpl.parseSystemProperties(ConfigurationImpl.java:308)
      	at org.apache.activemq.artemis.core.config.impl.ConfigurationImpl.parseSystemProperties(ConfigurationImpl.java:299)
      	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:488)
      	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:466)
      	at org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:412)
      	at org.wildfly.extension.messaging.activemq.jms.JMSService.doStart(JMSService.java:199)
      

      Problem is in ConfigurationImpl.parseSystemProperties:

      @Override
         public Configuration parseSystemProperties(Properties properties) throws Exception {
      
            Map<String, Object> beanProperties = new HashMap<>();
      
            for (Map.Entry<Object, Object> entry : properties.entrySet()) {
               if (entry.getKey().toString().startsWith(systemPropertyPrefix)) {
                  String key = entry.getKey().toString().substring(systemPropertyPrefix.length());
                  logger.debug("Setting up config, " + key + "=" + entry.getValue());
                  beanProperties.put(key, entry.getValue());
               }
            }
      
            if (!beanProperties.isEmpty()) {
               BeanSupport.setData(this, beanProperties);
            }
      
            return this;
         }
      

      where is iteration over Map which can be modified anytime another part of the server changes system properties.

      This code is not present in Artemis 1.1.x and thus it's a regression against EAP 7.0.x.

              jmesnil1@redhat.com Jeff Mesnil
              mnovak1@redhat.com Miroslav Novak
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: