You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/07/19 16:17:00 UTC

[jira] [Commented] (QPIDJMS-302) an NPE can occur when trying to throw a JMSException to indicate the connection failed

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

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

Commit cde08706b09d74931bc96fcd55d7bf24db960dce in qpid-jms's branch refs/heads/master from Robert Gemmell
[ https://git-wip-us.apache.org/repos/asf?p=qpid-jms.git;h=cde0870 ]

QPIDJMS-302: use an AtomicReference to track the exception/failure status rather than separate fields susceptible to races


> an NPE can occur when trying to throw a JMSException to indicate the connection failed
> --------------------------------------------------------------------------------------
>
>                 Key: QPIDJMS-302
>                 URL: https://issues.apache.org/jira/browse/QPIDJMS-302
>             Project: Qpid JMS
>          Issue Type: Bug
>          Components: qpid-jms-client
>    Affects Versions: 0.23.0
>            Reporter: Robbie Gemmell
>            Assignee: Robbie Gemmell
>             Fix For: 0.24.0
>
>
> The connection uses an AtomicBoolean and a volatile field to track the [first] exception leading to the connection being marked failed. The dual values aren't handled correctly, with the boolean tripped before the cause is recorded, and so concurrent use of them to throw an exception as actions are undertaken on the connection are unsafe, with potential for an NPE to occur instead of the intended exception being thrown. The exception field use is also probably unsafe in regards to its intent to contain the first failure.
> The issues can be avoided by using an AtomicReference to track the detail instead, as other resources like producer+consumer already do.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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