FeatureFlagUtil JS library functions can fail on network errors

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.1.0-rc0, 8.0.0-rc16
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • ALL
    • v8.0, v7.0
    • Workload Scheduling 2024-07-22
    • 200
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The FeatureFlagUtil JS library uses the "new Mongo(...)" syntax here to create a new connection to a mongod node.

      This syntax bypasses any runCommand or other JS-overrides and attempts to create a connection using the DBClientRS/DBClientConnection C++ code to back the new Mongo object. It's possible that the C++ code encounters a network error when establishing the connection. If we're using the library in an environment where such network errors are expected and should be retried, like a suite doing step-downs or kill-primaries in the background, we need to retry on these network errors.

      SERVER-91008 improved the situation here but the fix only works if we got an error back from the remote server before the connection is closed that we identify as retryable; this is because it expects there to be a code on the error. WE should additionally accomodate cases where we experience the network error 'locally' - that is, the underlying connection was closed before we got a response, and we get a network error from the OS.

      This can be accomplished by using isRetryableError from utils.js, or using the overriden globalThis.connect here to make the new connection.

              Assignee:
              George Wangensteen (Inactive)
              Reporter:
              George Wangensteen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: