[SERVER-81821] Document that POS framework doesn't guarantee Instance::run() is called after construction of instance Created: 03/Oct/23  Updated: 06/Dec/23  Resolved: 06/Dec/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Abdul Qadeer Assignee: Jason Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: 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
Participants:
Linked BF Score: 0

 Description   

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



 Comments   
Comment by Githook User [ 06/Dec/23 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}

Message: SERVER-81821 Document that POS Instance::run() won't execute if executor is shutdown

GitOrigin-RevId: 16e0cde891a7d44e8ff850b72197dfdd34b5721d
Branch: master
https://github.com/mongodb/mongo/commit/e95581b222c82690e730429410183588239debad

Comment by Jason Chan [ 04/Oct/23 ]

Thanks abdul.qadeer@mongodb.com, although this is a known problem, I agree we can try to improve the documentation until we find a more complete solution.

Generated at Thu Feb 08 06:47:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.