Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3405

Creating a change stream after retryable error fails even with retryReads=true

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.15.2
    • Affects Version/s: 1.15.1
    • Component/s: None
    • None

      When implementing the retryable read spec tests for the Swift driver, we were unable to pass the "client.watch succeeds on second attempt" case, which tests that watch will succeed if the underlying aggregate fails once.

      I tried a basic replication of this in C to confirm this was a libmongoc issue not a Swift one:

          mongoc_change_stream_t *stream = mongoc_client_watch(client, bson_new(), NULL);
          bson_error_t error;
          if (mongoc_change_stream_error_document(stream, &error, NULL)) {
              printf("%s\n", error.message);
          }
      

      with the following failPoint (same as the spec test)

      {
          configureFailPoint: "failCommand",
          mode: {
              times: 1
          },
          data: {
              failCommands: [
                  "aggregate"
              ],
              closeConnection: true
          }
      }
      

      and it prints:

      "Failed to send "aggregate" command with database "test": Failed to read 4 bytes: socket error or timeout"
      

      which is the same error we see in swift.

            Assignee:
            clyde.bazile@mongodb.com Clyde Bazile III (Inactive)
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: