[
https://issues.apache.org/jira/browse/QPID-7156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15203539#comment-15203539
]
Keith Wall commented on QPID-7156:
----------------------------------
I think {{AbstractVirtualHost#registerConnectionAsync()}} needs to ensure the
state of virtualhost is ACTIVE before registering the connection/assigning the
new scheduler. If the virtualhost is already in an non-ACTIVE state, the
method should close the connection (closeAsync) and return its future. This is
thread safe because all model operations on the virtualhost (including the
registering of connections and the stopping of the virtualhost) take place on
the single vhost executor thread. We need a supporting system test too.
> Possible Java Broker crash if connection is formed whilst virtualhost is
> stopping
> ---------------------------------------------------------------------------------
>
> Key: QPID-7156
> URL: https://issues.apache.org/jira/browse/QPID-7156
> Project: Qpid
> Issue Type: Bug
> Components: Java Broker
> Affects Versions: qpid-java-6.0, qpid-java-6.0.1
> Reporter: Keith Wall
> Fix For: qpid-java-6.0.2, qpid-java-6.1
>
>
> As reported here:
> http://qpid.2158936.n2.nabble.com/Java-broker-crashes-after-stopping-vhost-td7640284.html
> A race condition leads to the possibility of a NPE if the virtualhost is
> stopped as a new connection is formed. In the unlucky case, the task to
> associate the connection with the virtualhost gets executed after the virtual
> host's network connection scheduler is shutdown. This leads to a NPE. The
> Broker detects the NPE and shuts itself down.
> {noformat}
> 2016-03-18 06:41:06,748 ERROR [IO-/172.24.102.24:51029] (o.a.q.s.Main) -
> Uncaught exception, shutting down.
> java.lang.NullPointerException: null
> at
> org.apache.qpid.server.transport.NetworkConnectionScheduler.processConnection(NetworkConnectionScheduler.java:142)
> ~[qpid-broker-core-6.0.1.jar:6.0.1]
> at
> org.apache.qpid.server.transport.SelectorThread$ConnectionProcessor.processConnection(SelectorThread.java:505)
> ~[qpid-broker-core-6.0.1.jar:6.0.1]
> at
> org.apache.qpid.server.transport.SelectorThread$SelectionTask.performSelect(SelectorThread.java:338)
> ~[qpid-broker-core-6.0.1.jar:6.0.1]
> at
> org.apache.qpid.server.transport.SelectorThread$SelectionTask.run(SelectorThread.java:87)
> ~[qpid-broker-core-6.0.1.jar:6.0.1]
> at
> org.apache.qpid.server.transport.SelectorThread.run(SelectorThread.java:463)
> ~[qpid-broker-core-6.0.1.jar:6.0.1]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source) ~[na:1.8.0_51]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source) ~[na:1.8.0_51]
> at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_51]
> "
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]