[SERVER-42959] Communicate command failure with exceptions, not BSONObj Created: 21/Aug/19  Updated: 06/Dec/22  Resolved: 24/Feb/22

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: Backlog - Service Architecture
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Service Arch
Participants:

 Description   

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.



 Comments   
Comment by Lauren Lewis (Inactive) [ 24/Feb/22 ]

We haven’t heard back from you for at least one calendar year, so this issue is being closed. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Comment by Ratika Gandhi [ 15/Oct/19 ]

Consider this for QP 2020Q4. 

Generated at Thu Feb 08 05:01:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.