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

ASF subversion and git services commented on QPIDJMS-251:
---------------------------------------------------------

Commit 0aaf6d5e51beac49375de86b2dbfd7b98130d882 in qpid-jms's branch 
refs/heads/master from [~tabish121]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-jms.git;h=0aaf6d5 ]

QPIDJMS-251 Thread safety updates for state values in MessageConsumer

Make the MessageListener volatile to ensure it is visible to the
dispatcher task that is fired after it is set, and remove the unsafe
usage of the started flag and use the state of the messageQueue object
instead. 

> Thread unsafe use of MessageListener and state variable in JmsMessageConsumer
> -----------------------------------------------------------------------------
>
>                 Key: QPIDJMS-251
>                 URL: https://issues.apache.org/jira/browse/QPIDJMS-251
>             Project: Qpid JMS
>          Issue Type: Bug
>          Components: qpid-jms-client
>    Affects Versions: 0.11.1
>            Reporter: Timothy Bish
>            Assignee: Timothy Bish
>             Fix For: 0.20.0
>
>
> The assignment of the MessageListener in the MessageConsumer class is done to 
> a non-volatile value that can result in the initial run of the message 
> dispatch thread missing the value and delay dispatch.  Likewise the code uses 
> a state variable to track started state but the value is not accessed in a 
> thread safe way and the state can be missed.  The started value is 
> unnecessary as the internal message queue instance maintains a thread safe 
> running state that can be used for the same information.  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to