[SERVER-49104] Futurize ServiceStateMachine transitions Created: 25/Jun/20  Updated: 29/Oct/23  Resolved: 07/Aug/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.7.0

Type: New Feature Priority: Major - P3
Reporter: Benjamin Caimano (Inactive) Assignee: Andrew Chen (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-48978 Futurize ServiceEntryPoint::handleReq... Closed
Problem/Incident
Related
related to SERVER-50141 ServiceStateMachineTest needs to be r... Closed
is related to SERVER-50867 Roll back ServiceStateMachine changes... Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2020-07-27, Service Arch 2020-08-10
Participants:
Linked BF Score: 0

 Description   

ServiceStateMachine currently dispatches and schedules through a central function here. We should convert it to a future chain with four callbacks:

  • Source (or skip if exhaust)
  • Process a.k.a. Parse and handle
  • Sink (or skip if moreToCome)
  • Cleanup and Poll

This will make maintaining this code easier and it also allows us to do future continuations in any of these callbacks. For source and sink steps, they are already futurized via the SessionASIO. For the process step, we can convert ServiceEntryPoint::handleRequest() to return a Future<DbResponse> instead of a DbResponse. This means that command responses that would block on thread can now be fully asynchronous instead. It also means that if a request should be processed on a dedicated thread, we can schedule onto the right executor and return a future that runs inline on it.



 Comments   
Comment by Githook User [ 14/Sep/20 ]

Author:

{'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}

Message: SERVER-50867 Roll back ServiceStateMachine changes temporarily

This reverts these commits:
b039b24746e1d1fb10a32e1ca4831423c01d4cd7: SERVER-48980
97e16187ff3065d242a61a52e7b6edd4d439fb30: SERVER-49072
0607a6c291bf4cf4580a4444d826ed3c3ac3df47: SERVER-49104
Branch: master
https://github.com/mongodb/mongo/commit/827a25eb01bc5ddf766b3a543ef0ba5112953e1b

Comment by Githook User [ 14/Sep/20 ]

Author:

{'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}

Message: SERVER-50867 Roll back ServiceStateMachine changes temporarily

This reverts these commits:
b039b24746e1d1fb10a32e1ca4831423c01d4cd7: SERVER-48980
97e16187ff3065d242a61a52e7b6edd4d439fb30: SERVER-49072
0607a6c291bf4cf4580a4444d826ed3c3ac3df47: SERVER-49104
Branch: fixed_thread_pool_handshaking
https://github.com/mongodb/mongo/commit/575f370475bd31fc457a93a776061f1b80448028

Comment by Githook User [ 06/Aug/20 ]

Author:

{'name': 'Andrew Chen', 'email': 'a.chen@mongodb.com', 'username': 'AndrooTheChen'}

Message: SERVER-49104 Futurize Service State Machine
Branch: master
https://github.com/mongodb/mongo/commit/0607a6c291bf4cf4580a4444d826ed3c3ac3df47

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