[SERVER-62936] Periodically check for cancelation while loading state documents Created: 24/Jan/22  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: sa-remove-fv-backlog-22
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Participants:

 Description   

PrimaryOnlyService should periodically check for cancelation while loading state documents (see here and here). The following is an example of a loop used to load state documents:

...
FindCommandRequest findRequest{ns};
auto cursor = client.find(std::move(findRequest));
while (cursor->more()) {
    stateDocuments.push_back(cursor->nextSafe().getOwned());
}
...

The current implementation keeps following the cursor regardless of service cancelation. Periodically checking for cancelation and interrupting the above loop would make services response faster to cancelation.


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