Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-746

Drivers should retry operations if connection handshake fails

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: Retryability
    • Labels:
      None
    • Needed
    • Hide
      Show
      Retryable reads tests now have a legacy and unified directories Sync unified handshakeError retryable reads and retryable writes tests to mongodb/specifications@0823060 Sync unified retryable-abort-handshake and retryable-commit-handshake transaction tests with mongodb/specifications@0823060 . These have been written but are skipped pending DRIVERS-2032 .
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4192 Fixed 1.24.0
      CXX-2393 Fixed 3.8.0
      CSHARP-3919 Fixed 2.15.0
      GODRIVER-2191 Blocked
      JAVA-4354 Fixed 4.6.0
      NODE-3688 Fixed 4.6.0
      PHPLIB-1042 Blocked
      PYTHON-2951 Fixed 4.1
      MOTOR-836 Duplicate
      RUBY-2815 Fixed 2.18.0
      RUST-1064 Fixed 2.2.0
      SWIFT-1378 Fixed 1.4.0
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-4192 Fixed 1.24.0 CXX-2393 Fixed 3.8.0 CSHARP-3919 Fixed 2.15.0 GODRIVER-2191 Blocked JAVA-4354 Fixed 4.6.0 NODE-3688 Fixed 4.6.0 PHPLIB-1042 Blocked PYTHON-2951 Fixed 4.1 MOTOR-836 Duplicate RUBY-2815 Fixed 2.18.0 RUST-1064 Fixed 2.2.0 SWIFT-1378 Fixed 1.4.0

      This ticket is intended to track the work required to make all drivers resilient to connection handshake network errors with respect to retryable reads and writes.

      Currently, the retryable reads and retryable writes specifications do not require that operations are retried in the following case:

      • the driver successfully selects a server for the operation
      • there is no idle connection already available in the pool
      • the driver attempts to open a new connection to the server and complete the connection handshake
      • the connection handshake fails with a network error

      Instead, the specifications allow drivers to fail the operation without retrying, even though retrying would be safe in this case for both reads and writes.

      One could read these specifications such that network errors during a connection handshake fall under the definition of retryable error, but the specifications are not explicit that this applies to the handshake and in practice multiple drivers do not interpret it that way, and there are no tests defined to assert the behavior.

      Similarly, the server selection spec states that

      After a server is selected, several error conditions could still occur that make the selected server unsuitable for sending the operation, such as:

      • the server could have shutdown the socket (e.g. a primary stepping down),
      • a connection pool could be empty, requiring new connections; those connections could fail to connect or could fail the server handshake

      This specification does not require nor prohibit drivers from attempting automatic recovery for various cases where it might be considered reasonable to do so, such as:

      • repeating server selection if, after selection, a socket is determined to be unsuitable before a message is sent on it

      but note it's not a MUST in the specification so in practice drivers differ in the behavior.

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Jeffrey Yemin Jeffrey Yemin
            Rachelle Palmer Rachelle Palmer
            Votes:
            6 Vote for this issue
            Watchers:
            32 Start watching this issue

              Created:
              Updated: