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

Communicate command failure with exceptions, not BSONObj

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Service Arch

      An idea from 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.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: