-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
Server Programmability
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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.