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

Futurize ServiceStateMachine transitions

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.7.0
    • None
    • None
    • Fully Compatible
    • Service Arch 2020-07-27, Service Arch 2020-08-10
    • 0

    Description

      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.

      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: