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

Deduplicate IDL library used by Async RPC API

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc4
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible

      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.

            Assignee:
            patrick.freed@mongodb.com Patrick Freed
            Reporter:
            jason.chan@mongodb.com Jason Chan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: