[SERVER-72684] Deduplicate IDL library used by Async RPC API Created: 10/Jan/23  Updated: 12/Jan/23

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Jason Chan Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-69977 Extend RemoteCommandRunner API to all... Closed
Assigned Teams:
Service Arch
Participants:

 Description   

SERVER-69977 planned to enrich the async_rpc::sendCommand API to handle generic argument and reply fields by:

  • Having the API accept an argument of a type that represented the generic arguments
  • Extending the AsyncRPCResponse returned to include a type that represented the generic reply fields

The plan was to hand-craft the types that represented the generic arguments and replies. However, when we tried this, we found that the types we wrote looked almost identical to the IDL-generated structures. (See https://github.com/10gen/mongo/pull/8622) Therefore, we tried to see if we could use the IDL generated types instead of hand-crafting our own.

The problem here was that when we attempted to add types to the IDL-generated code, we ran into a difficult circular-dependency problem, because the server_base library depends on the generic_arguments IDL structure to generate parsers for other IDL defined-types, and the types of each generic_argument are often IDL-defined.

We decided to get around this by simply duplicating the geneeric_arguments IDL structure, and having the typed version as its own library that isn’t dependent-upon by base libraries needed to generate parsers.

The workaround above is not ideal given the duplication of code, and this ticket should be to investigate and implement a way to remove the duplication.


Generated at Thu Feb 08 06:22:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.