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

Futurize ServiceStateMachine transitions

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Service Arch 2020-07-27, Service Arch 2020-08-10
    • 0

      ServiceStateMachine currently dispatches and schedules through a central function here. We should convert it to a future chain with four callbacks:

      • Source (or skip if exhaust)
      • Process a.k.a. Parse and handle
      • Sink (or skip if moreToCome)
      • Cleanup and Poll

      This will make maintaining this code easier and it also allows us to do future continuations in any of these callbacks. For source and sink steps, they are already futurized via the SessionASIO. For the process step, we can convert ServiceEntryPoint::handleRequest() to return a Future<DbResponse> instead of a DbResponse. This means that command responses that would block on thread can now be fully asynchronous instead. It also means that if a request should be processed on a dedicated thread, we can schedule onto the right executor and return a future that runs inline on it.

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

              Created:
              Updated:
              Resolved: