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.
- is related to
-
SERVER-69977 Extend RemoteCommandRunner API to allow for Generic Passthrough Fields
- Closed
-
SERVER-88214 Add types to generic_argument.idl
- Closed