[
https://issues.apache.org/jira/browse/QPID-3807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201405#comment-13201405
]
Keith Wall commented on QPID-3807:
----------------------------------
It seems to me that the only explanation for QPID-3872 is a publication issue.
At the minute, reads of members _dispatcher and _dispatcherThread are not
thread safe and therefore a thread could read a stale values.
It appears that is what has happened in QPID-3872. The dispatcher thread was
running run(), it called #dispatch() which first checked whether the
_dispatcher member is non-null. In our failing case, the _dispatcher member
was null. This could not normally be the case as _dispatcher is assigned
before the Dispatcher thread is created (in startDispatcherIfNecessary).
I'm suggest changing _dispatcher and _dispatcherThread to volatile. The
synchronisation within startDispatcherIfNecessary() should remain. The setters
setDispatcherThread and setDispatcher are unused and should be removed.
> Improve the thread safety of JMS session dispatcher
> ---------------------------------------------------
>
> Key: QPID-3807
> URL: https://issues.apache.org/jira/browse/QPID-3807
> Project: Qpid
> Issue Type: Improvement
> Components: Java Client
> Affects Versions: 0.15
> Reporter: Alex Rudyy
>
> The access to the AMQSession#_dispatcher is not a thread safe and can result
> in thread safety issues.
> One of this issue is reported in QPID-3782.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]