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

Improve interruption of PrimaryOnlyService instances

    • Service Arch
    • Service Arch 2022-08-08, Service Arch 2022-08-22, Service Arch 2022-09-05, Service Arch 2022-09-19

      As part of integrating CancellationToken with the code-base, the interruption interface of PrimaryOnlyService is being replaced by CancellationToken (e.g., see this commit). As a result, the unit-tests for the interrupt interface are disabled and the run interface for each service receives a CancellationToken. However, the move towards using cancellation tokens to interrupt instances of PrimaryOnlyService is incomplete:

      • Interrupting an instance through a CancellationToken does not notify the service about the reason for cancellation. Therefore, some services use multiple cancellation tokens internally, and others still rely on the interruption interface.
      • The interruption interface is not deprecated, but it is not being tested. The interface already has some known issues that must be fixed if we decide to keep.

      This ticket should extend the functionally of CancellationToken to relay a Status to instances of PrimaryOnlyService and deprecate the interruption interface, or reenable the unit-tests for the interruption interface and fix its existing issues.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: