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

Do not reuse server stream that becomes invalid on failure to end session

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.17.0-beta, 1.17.0
    • Component/s: bulk, libmongoc
    • Labels:
      None
    • Story Points:
      2

      Description

      A mongoc_server_stream_t should not be reused after calling mongoc_cluster_run_command_monitored on with the stream.

      In two situations, the stream will disconnect and be invalidated:

      • a network error (example)
      • a "not master" or "node is recovering error" for pre 4.2 server (here)

      When that happens, the server_stream for that operation is no longer valid. But we do not always account that correctly.

      _mongoc_write_opmsg (incorrectly) always ends unordered bulk operations on error because of CDRIVER-3305. Once that is resolved, it will need to handle the case of an invalidated server stream.

      _mongoc_write_opquery only sets must_stop to true for what it deems is a network error (of which, that check might not be quite right if error labels were applied). But it does not handle the case of a "not master" or "node is recovering" error causing a disconnect.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              roberto.sanchez Roberto Sanchez
              Reporter:
              roberto.sanchez Roberto Sanchez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: