You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Keith Wall (JIRA)" <ji...@apache.org> on 2016/04/13 13:16:25 UTC

[jira] [Commented] (QPID-7196) [Java Broker] ConcurrentModificationException can occur on Broker startup when virtual host is activated

    [ https://issues.apache.org/jira/browse/QPID-7196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15239079#comment-15239079 ] 

Keith Wall commented on QPID-7196:
----------------------------------

I think we need to review all the places in the code where we call System#setProperty or System#setProperties.    On the Broker side we will probably want to ensure that we mutate all system properties early in the Broker life when it is still single threaded and then from that point forward treat System properties as read-only.   With the example above, we are mutating the environment every time we start a Derby VNN/VH.

On client is harder, as we can't predicate when in an application's life it will load the Qpid client library and know what the application's thread may be doing.  Perhaps all we can do it ensure that System properties are mutated from a single point and document what the user needs to do in order to know all initialisation is complete.


> [Java Broker] ConcurrentModificationException can occur on Broker startup when virtual host is activated
> --------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-7196
>                 URL: https://issues.apache.org/jira/browse/QPID-7196
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: qpid-java-6.0.1, qpid-java-6.1
>            Reporter: Alex Rudyy
>             Fix For: qpid-java-6.1
>
>
> ConcurrentModificationException is observed on broker start-up having 2 virtual hosts with hundreds of queues. One host was DERBY VH and the other was BDB VH. 
> {noformat}
> 2016-04-12 15:25:40,391 ERROR [VirtualHostNode-test-Config] (o.a.q.s.m.AbstractConfiguredObject) - Failed to open object with name 'test'.  Object will be put into ERROR state.
> java.util.ConcurrentModificationException: null
>         at java.util.Hashtable$Enumerator.next(Hashtable.java:1367) ~[na:1.8.0_66]
>         at java.util.HashMap.putMapEntries(HashMap.java:511) ~[na:1.8.0_66]
>         at java.util.HashMap.putAll(HashMap.java:784) ~[na:1.8.0_66]
>         at org.apache.qpid.server.model.AbstractConfiguredObject.getContextKeys(AbstractConfiguredObject.java:2758) [classes/:na]
>         at org.apache.qpid.server.store.berkeleydb.BDBUtils.getCacheMode(BDBUtils.java:161) ~[classes/:na]
>         at org.apache.qpid.server.store.berkeleydb.StandardEnvironmentFacadeFactory$1.getCacheMode(StandardEnvironmentFacadeFactory.java:66) ~[classes/:na]
>         at org.apache.qpid.server.store.berkeleydb.StandardEnvironmentFacade.<init>(StandardEnvironmentFacade.java:110) ~[classes/:na]
>         at org.apache.qpid.server.store.berkeleydb.StandardEnvironmentFacadeFactory.createEnvironmentFacade(StandardEnvironmentFacadeFactory.java:82) ~[classes/:na]
>         at org.apache.qpid.server.store.berkeleydb.BDBMessageStore.openMessageStore(BDBMessageStore.java:80) ~[classes/:na]
>         at org.apache.qpid.server.virtualhost.AbstractVirtualHost.onActivate(AbstractVirtualHost.java:1871) ~[classes/:na]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_66]
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_66]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_66]
>         at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_66]
>         at org.apache.qpid.server.model.AbstractConfiguredObject.attainState(AbstractConfiguredObject.java:1308) [classes/:na]
>         at org.apache.qpid.server.model.AbstractConfiguredObject.attainState(AbstractConfiguredObject.java:1287) [classes/:na]
>         at org.apache.qpid.server.model.AbstractConfiguredObject$8.onSuccess(AbstractConfiguredObject.java:908) [classes/:na]
>         at org.apache.qpid.server.model.AbstractConfiguredObject$8.onSuccess(AbstractConfiguredObject.java:902) [classes/:na]
>         at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319) [guava-18.0.jar:na]
>         at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457) [guava-18.0.jar:na]
>         at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156) [guava-18.0.jar:na]
>         at com.google.common.util.concurrent.ExecutionList.add(ExecutionList.java:101) [guava-18.0.jar:na]
>         at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:170) [guava-18.0.jar:na]
>         at com.google.common.util.concurrent.Futures.addCallback(Futures.java:1322) [guava-18.0.jar:na]
>         at com.google.common.util.concurrent.Futures.addCallback(Futures.java:1258) [guava-18.0.jar:na]
>         at org.apache.qpid.server.model.AbstractConfiguredObject.doAttainState(AbstractConfiguredObject.java:901) [classes/:na]
>         at org.apache.qpid.server.model.AbstractConfiguredObject.access$300(AbstractConfiguredObject.java:80) [classes/:na]
>         at org.apache.qpid.server.model.AbstractConfiguredObject$1.execute(AbstractConfiguredObject.java:513) [classes/:na]
>         at org.apache.qpid.server.model.AbstractConfiguredObject$1.execute(AbstractConfiguredObject.java:500) [classes/:na]
>         at org.apache.qpid.server.model.AbstractConfiguredObject$2.execute(AbstractConfiguredObject.java:561) [classes/:na]
>         at org.apache.qpid.server.model.AbstractConfiguredObject$2.execute(AbstractConfiguredObject.java:554) [classes/:na]
>         at org.apache.qpid.server.configuration.updater.TaskExecutorImpl$TaskLoggingWrapper.execute(TaskExecutorImpl.java:270) [classes/:na]
>         at org.apache.qpid.server.configuration.updater.TaskExecutorImpl$CallableWrapper$1.run(TaskExecutorImpl.java:342) [classes/:na]
>         at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_66]
>         at javax.security.auth.Subject.doAs(Subject.java:360) [na:1.8.0_66]
>         at org.apache.qpid.server.configuration.updater.TaskExecutorImpl$CallableWrapper.call(TaskExecutorImpl.java:335) [classes/:na]
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_66]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_66]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_66]
>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org