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

Futurize ServiceEntryPoint::handleRequest()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.7.0
    • None
    • None
    • Fully Compatible
    • Service arch 2020-06-29, Service arch 2020-07-13, Service Arch 2020-07-27, Service Arch 2020-08-10

    Description

      ServiceEntryPoint is the second piece of our command pathway after ServiceStateMachine. They meet here when handleRequest() is invoked. Let's convert that virtual function signature,

      DbResponse handleRequest(OperationContext* opCtx, const Message& request);

      will become

      Future<DbResponse> handleRequest(OperationContext* opCtx, const Message& request) noexcept;

      Futures can be made from their payload type (see here), so converting each overridden function for derived classes should be simple for now. The noexcept implies that no exception should ever leave handleRequest().

      Once we have that future in ServiceStateMachine::_processMessage(), we can take the post processing here as an onCompletion() callback and then call get() to synchronize the asynchronous execution on the local thread.

      Attachments

        Issue Links

          Activity

            People

              a.chen@mongodb.com Andrew Chen (Inactive)
              ben.caimano@mongodb.com Benjamin Caimano (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: