[SERVER-55657] Improve interruption of PrimaryOnlyService instances Created: 30/Mar/21  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: sa-remove-fv-backlog-22
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-51012 Integrate CancelationTokens with Prim... Closed
Assigned Teams:
Service Arch
Sprint: Service Arch 2022-08-08, Service Arch 2022-08-22, Service Arch 2022-09-05, Service Arch 2022-09-19
Participants:

 Description   

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.



 Comments   
Comment by Matt Diener (Inactive) [ 20/Sep/22 ]

I don't think this is the appropriate fix for the POS improvements epic but the project should provide guidance and/or better tooling for cancellation/error handling in POS instances.

Comment by Matt Diener (Inactive) [ 20/Sep/22 ]

Moving back to open and keeping the draft PR open for the POC. Ideally we simplify interruption in a better way as part of the POS project. 

Generated at Thu Feb 08 05:37:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.