[SERVER-48978] Futurize ServiceEntryPoint::handleRequest() Created: 18/Jun/20  Updated: 29/Oct/23  Resolved: 30/Jul/20

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

Type: Improvement 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
is depended on by SERVER-49104 Futurize ServiceStateMachine transitions Closed
Related
is related to SERVER-46653 Guard return path from ServiceEntryPo... Open
Backwards Compatibility: Fully Compatible
Sprint: Service arch 2020-06-29, Service arch 2020-07-13, Service Arch 2020-07-27, Service Arch 2020-08-10
Participants:

 Description   

ServiceEntryPoint is the second piece of our command pathway after ServiceStateMachine. They meet here when handleRequest() is invoked. Let's convert that virtual function signature,

DbResponse handleRequest(OperationContext* opCtx, const Message& request);

will become

Future<DbResponse> handleRequest(OperationContext* opCtx, const Message& request) noexcept;

Futures can be made from their payload type (see here), so converting each overridden function for derived classes should be simple for now. The noexcept implies that no exception should ever leave handleRequest().

Once we have that future in ServiceStateMachine::_processMessage(), we can take the post processing here as an onCompletion() callback and then call get() to synchronize the asynchronous execution on the local thread.



 Comments   
Comment by Githook User [ 30/Jul/20 ]

Author:

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

Message: SERVER-48978 Futurize handleRequest
Branch: master
https://github.com/mongodb/mongo/commit/051bd6e51b33d7fd8a1265e166efffd20178a86d

Comment by Githook User [ 30/Jul/20 ]

Author:

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

Message: SERVER-48978 Futurize handleRequest in mongo enterprise module
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/e3c95872ad03026da2438e00576047e93bb220cd

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