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

Document that POS framework doesn't guarantee Instance::run() is called after construction of instance

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Service Arch 2023-10-16, Service Arch 2023-10-30, Service Arch 2023-11-13, Service Arch 2023-11-27, Service Arch 2023-12-11
    • 2

      During the lifetime of an active instance after its construction here, a step down can cause the scoped executor to shut down here before it actually calls the run method.

      The issue with this arises if the same node steps up and the POS framework tries to join and destroy previously active instances. The POS service subclasses may have an internal state that needs to be updated before destruction and they may rely on the Instance::run() method being guaranteed to be called to ascertain that. While this is not a bug with POS, it will be nice to help users avoid this scenario where Instance::run() may not be called perhaps by using unsafeToInlineFuture() before calling Instance::run() or at the very least by noting it down in the existing notes here so that users can handle it cleanly when implementing a new service.

      FWIW this issue surfaced fromĀ BF-30149

            Assignee:
            jason.chan@mongodb.com Jason Chan
            Reporter:
            abdul.qadeer@mongodb.com Abdul Qadeer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: