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

Reflow the SessionWorkflow loop

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Service Arch 2022-09-05, Service Arch 2022-09-19, Service Arch 2022-10-03, Service Arch 2022-10-17, Service Arch 2022-10-31, Service Arch 2022-11-14, Service Arch 2022-11-28, Service Arch 2022-12-12
    • 120

      Redo the control flow between SessionWorkflow's scheduleNewLoop and startNewLoop.
      (Details TBD)

      This is difficult to follow. scheduleNewLoop schedules startNewLoop on the executor. The last thing the startNewLoop does is a getAsync to make scheduleNewLoop happen again, so there's a loop of mutual recursion.

      Both functions behave differently based on whether the current command is an exhaust command or not. This is pretty weird, because the logic is distributed and there's not a clear line of execution. The significant thing about exhaust commands is that they skip the sourceMessage step, but after that they should behave the same as non-exhaust commands.

      Refactor this loop so that each "loop" sets up a Future and attaches the appropriate continuations to get a single request received, processed, and sent. That's the goal. If that "request receive" part is a no-op, then the Future chain will be a little different. That's fine. The important thing is that we unify the exhaust-non-exhaust paths and get a clear linear execution that can be read off in the source code.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: