ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: CSOT
    • Not Needed
    • None
    • Hide

      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.

      Show
      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.
    • None
    • None
    • None
    • None
    • None
    • None

      Use Case

      As a developer using timeoutMS,
      I want a connection to be closed when an operation times out after its command was already written,
      So that a later operation on that pooled connection never receives the earlier command's reply.

      User Experience

      With timeoutMS set and a slow app-to-database link, a write that uses almost all of the time budget makes sendWire throw MongoOperationTimeoutError: Server roundtrip time is greater than the time remaining. The connection is not closed, so it goes back to the pool with the server's reply unread. Every later operation on that connection gets the previous operation's reply, and nothing reports it. In an app, this can return one user's document to another.

      Expected: the connection is closed, the operation fails with a timeout, and later operations get a fresh connection.

      Impact: versions 6.11.0 through 7.7.0. It needs timeoutMS (still @experimental), a measured RTT above 0, and a write that finishes with less than the min RTT remaining.

      Dependencies

      None upstream. The release needs a coordinated patch for the 6.x and 7.x lines.

      Risks/Unknowns

      • Other drivers may have the same copy-after-write pattern.

      Acceptance Criteria

      Implementation Requirements

      • In Connection.sendWire, the post-write RTT check calls this.onError(error) before throwing, so the socket is destroyed and connection.closed is true.

      Testing Requirements

      • Unit test (next to the NODE-6412 tests) with a mock socket and a TimeoutContext where remainingTimeMS < minRoundTripTime after the write. Assert connection.closed, and that the pool destroys the connection on check-in.
      • Regression test that a later operation on the same pool doesn't receive the earlier reply.

      Documentation Requirements

      • N/A

      Follow Up Requirements

      • Release 6.x and 7.x patches.
      • Add prose/unit tests to the spec.

            Assignee:
            Unassigned
            Reporter:
            Sergey Zelenov
            None
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: