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

[Python Client for AMQP 0-8,0-9] Race condition when creating session

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

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • qpid-python-1.35.0, qpid-python-1.36.0, qpid-python-1.37.0
    • qpid-python-1.38.0
    • Python Client
    • None

    Description

      It seems that Client.session() is not thread safe. There seems to be a race condition that means two concurrent calls can actually share the same underlying session.

      Client.session() acquires self.lock and determines a free session id. It then releases the lock before calling self.channel(id) which acquires the lock again and allocates the id and creates the session.
      If a second call to Client.session() happens in the moment the lock is released but before self.channel(id) reacquires it the second call will find the same free id and will then subsequently return the same session object from self.channel(id).

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            lorenz.quack Lorenz Quack

            Dates

              Created:
              Updated:

              Slack

                Issue deployment