[SERVER-51012] Integrate CancelationTokens with PrimaryOnlyService Created: 17/Sep/20  Updated: 29/Oct/23  Resolved: 25/Nov/20

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

Type: Improvement Priority: Major - P3
Reporter: Matthew Saltz (Inactive) Assignee: Jason Zhang
Resolution: Fixed Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-52750 Remove the usage of ScopedTaskExecuto... Backlog
is depended on by SERVER-52751 Remove the interrupt() function from ... Backlog
Problem/Incident
Related
related to SERVER-55657 Improve interruption of PrimaryOnlySe... Backlog
related to SERVER-51179 TenantMigrationDonorInstance should d... Closed
is related to SERVER-51017 Add unittest for PrimaryOnlyService::... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Sharding 2020-11-16, Sharding 2020-11-30
Participants:
Linked BF Score: 0

 Description   

Use CancelationTokens for PrimaryOnlyService to help with the cancelation of running instances.

There are three aspects of this:

  • Make PrimaryOnlyService and instances own a CancelationSource, and pass tokens from the source to the Instance::run function
  • Remove the usage of ScopedTaskExecutor in favor of using the base executor and CancelationToken-accepting functions on TaskExecutor (SERVER-52750)
  • Remove the interrupt() function from PrimaryOnlyService::Instance and use CancelationToken cancelation to handle interruptions instead (SERVER-52751)

This ticket tracks the first bullet point.



 Comments   
Comment by Githook User [ 25/Nov/20 ]

Author:

{'name': 'Jason Zhang', 'email': 'jason.zhang@mongodb.com', 'username': 'jz1242'}

Message: SERVER-51012 Integrate CancelationTokens with PrimaryOnlyService
Branch: master
https://github.com/mongodb/mongo/commit/893887421601e14adb2cbcc4df68a4524cef2d45

Comment by Spencer Brody (Inactive) [ 21/Sep/20 ]

Ideally this will allow us to remove the interrupt() virtual method from the PrimaryOnlyService::Instance interface.

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