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

Communicate command failure with exceptions, not BSONObj

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Internal Code
    • Labels:
      None

      Description

      An idea from Andy Schwerin as a spinoff from the "Reduce Client Time To Recovery On Topology Changes" project:

      It would be nicer if commands could only fail by throwing exceptions out of run(), which would clear the contents of the built reply and replace it with an encoding of the exception. Letting commands add their own "ok" field in the body of "run" was probably a mistake in the original design of Command which predates the BasicCommand implementation.

      The current design requires commands to encode "ok: 1" in the reply body. ServiceEntryPoint must determine command success by parsing the just-generated command body for an "ok" field.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: