[SERVER-49106] Add poll function to the ServiceExecutor API Created: 25/Jun/20  Updated: 29/Oct/23  Resolved: 28/Jul/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: Amirsaman Memaripour
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-49848 Add interface to check single-threade... Closed
Gantt Dependency
has to be done after SERVER-49105 Create fixed thread pool ServiceExecutor Closed
Backwards Compatibility: Fully Compatible
Sprint: Service arch 2020-07-13, Service Arch 2020-07-27, Service Arch 2020-08-10
Participants:

 Description   

If we are on a thread pool, we want to avoid blocking threads while waiting for new data to read. This would imply that a thread somewhere is [e]polling for us, most likely an ASIOReactor. However, if we’re already on a dedicated thread, we want to block our own thread. To solve this contradiction, we want to provide a function Future<void> ServiceExecutor::waitForData(Session*) that polls and then reschedules execution for its future. We should be able to invoke asio::async_read with an asio::null_buffers, thus copying no data until we are safely on the correct thread.



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

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-49106 Add poll function to the ServiceExecutor API
Branch: master
https://github.com/mongodb/mongo/commit/165dfb50f7693cadb80e988d08222700b1cc6b5c

Comment by Githook User [ 23/Jul/20 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: Revert "SERVER-49106 Add poll function to the ServiceExecutor API"

This reverts commit a3ed860ba4fbb9a662440c8e9608fef5fa6c8712.
Branch: master
https://github.com/mongodb/mongo/commit/15d23a48c8a8767ce3c5fc5165d5888608a454b4

Comment by Githook User [ 22/Jul/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-49106 Add poll function to the ServiceExecutor API
Branch: master
https://github.com/mongodb/mongo/commit/a3ed860ba4fbb9a662440c8e9608fef5fa6c8712

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