Uploaded image for project: 'Qpid JMS'
  1. Qpid JMS
  2. QPIDJMS-302

an NPE can occur when trying to throw a JMSException to indicate the connection failed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.23.0
    • 0.24.0
    • qpid-jms-client
    • None

    Description

      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.

      Attachments

        Activity

          People

            robbie Robbie Gemmell
            robbie Robbie Gemmell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: