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

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

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.0.0-rc0
    • Replication
    • None
    • Fully Compatible
    • Repl 2018-05-07

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              tess.avitabile@mongodb.com Tess Avitabile (Inactive)
              spencer@mongodb.com Spencer Brody (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: