You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Robbie Gemmell (JIRA)" <ji...@apache.org> on 2017/07/19 16:14:01 UTC

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

Robbie Gemmell created QPIDJMS-302:
--------------------------------------

             Summary: 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