[SERVER-67218] Remove ServiceStateMachine::setCleanupHook Created: 11/Jun/22  Updated: 29/Oct/23  Resolved: 17/Jun/22

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

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-67230 ServiceEntryPoint accepts 1 more sess... Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2022-06-27
Participants:
Linked BF Score: 124

 Description   

This hook allows an arbitrary listener to monitor for ServiceStateMachine cleanup.
But the only user is ServiceEntryPointImpl, which creates and owns all ServiceStateMachine instances, and already has an onClientDisconnect hook.

ServiceStateMachine disconnects its Client as part of its cleanup process, and part of this is calling the ServiceEntryPoint::onClientDisconnect(Client*) virtual function AND THEN the installed _cleanupHook if any.

The Mongod ServiceEntryPointImpl doesn't override onClientDisconnect, but does install a ssm.setCleanupHook.

ServiceEntryPointMongos is the opposite: it doesn't install a ssm.setCleanupHook but DOES override onClientDisconnect.

If there's some reason the onClientDisconnect must be followed by a LATER call to the installed cleanupHook we should clearly document that and change the SEP to have two SEP Client cleanup notifications with the same style of API. I suspect that we could probably be able to just combine them under the existing onClientDisconnect callback and remove ServiceStateMachine::setCleanupHook.

PM-2766



 Comments   
Comment by Githook User [ 17/Jun/22 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-67218 remove SSM::onCleanupHook by changing ServiceEntryPointImpl SSMList data structure
Branch: master
https://github.com/mongodb/mongo/commit/912818162a086bd85e578913d90a0c91cd6bfb11

Comment by Billy Donahue [ 13/Jun/22 ]

The SEPImpl might affect or even fix BF-22149, for which we have no root cause, but it's a SSM lifecycle problem.

Comment by Billy Donahue [ 13/Jun/22 ]

This is preliminary/parallel work to the design doc, reducing the interfaces to SSM.

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