Add failpoint to fail commands with network errors or arbitrary error codes

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.0.0-rc0
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • Repl 2018-05-07
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      To aid testing, especially for drivers, we should have a failpoint that can induce arbitrary command failures.

      Configuring such a failpoint would look like:

      node.adminCommand({
        configureFailPoint: 'failCommand',
        mode: 'alwaysOn',
        data: {
          closeConnection: false, // If true, closes the current socket when the fail point is hit
          errorCode: ErrorCodes.NotMaster // If set, causes the command to return the given code without actually executing.  Incompatibile with 'closeConnection'
        }
      });
      

      This failpoint will not be triggered for isMaster, configureFailPoint, or buildinfo.

            Assignee:
            Tess Avitabile (Inactive)
            Reporter:
            Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: