Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-3042

Session.attach could be sent before the connection is open.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6, 0.7, 0.8
    • 0.10
    • JMS AMQP 0-x
    • None

    Description

      This bug was discovered while investigating QPID-2994
      This bug also caused QPID-3033

      There exist a race condition where an application could create a new session (recreating due to an exception or a completely new session in the midst of failover) before the connection is open.
      This results in session attach being sent before the connection negotiation is completed. All though the connect method and the createSession method in Connection.java contends for the same lock, the connect method which acquires it early, will releases the lock when it waits (until the connection achieves OPEN state) and the createSession method waiting on the lock will get it and continue.

      Usually this only becomes an issue during failover, as during the initial connection creation, the application thread that creates the connection will wait until the connect method returns before it creates a session.
      However If an application tries to create a connection in one thread and several other threads try to create sessions from that connection, and if those threads don't coordinate properly to check if the connection is opened, then this same race condition is present.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rajith Rajith Muditha Attapattu
            rajith Rajith Muditha Attapattu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment