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

Closing a connection thread safety

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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.

            Assignee:
            kbanker Kyle Banker
            Reporter:
            kbanker Kyle Banker
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: