Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-285

Closing a connection thread safety

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Component/s: None
    • Labels:
      None

      Description

      http://groups.google.com/group/mongodb-user/browse_thread/thread/5ea1525106b6805e

      "This specific issue turned out to be caused by thread closing to
      early, shutting down the mongoconnection but keeping the rabbitMQ
      connection alive. So when a message arrived it tried to access mongo
      through a closed connection."

      I'm guessing that the sequence goes something like this:

      1. Thread A checks out a socket.
      2. Thread B calls Connection#close (or perhaps there's some kind of socket error that closes connections)
      3. Thread A attempts to write on socket, fails because the socket has been close, and itself tries to close the socket.

      Probably need to synchronize access to @sockets in Pool class.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: