Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-34551

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

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

      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@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: