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

client driver loses synchronization with comunication stream due to exceptions at certain points

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Works as Designed
    • Affects Version/s: 1.1.4, 1.1.5
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
      None
    • Environment:
      mongo server 1.6.5
    • Backwards Compatibility:
      Fully Compatible
    • # Replies:
      4
    • Last comment by Customer:
      true

      Description

      The ruby client driver loses track of its position in the stream of responses from the server if an exception occurs while Connection#send_with_safe_check or Connection#receive_message are running. This commonly occurs when the client application uses a Timeout; a Timeout::Error exception may be raised while Connection#receive is blocked. Other exceptions are possible here (due to other asynchronous signals or perhaps due to unexpected IO conditions). When an exception occurs at this point, the server will eventually send a response, but the client driver is no longer waiting for it. The response is typically consumed by the subsequent mongo operations; all following request appear to get the response from the preceding request.

      (Unless there is a sequence number in the mongo protocol that is being ignored by the client driver...) I'd advise adding an exception handler to the critical section of Connection#receive_message and Connection#send_with_safe_check that closes the socket when any exception occurs. (See attached patch)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kbanker Kyle Banker
                Reporter:
                joshuanapoli Joshua Napoli
                Participants:
                Last commenter:
                Rathi Gnanasekaran
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since reply:
                  6 years, 33 weeks, 3 days ago
                  Date of 1st Reply: