Periodically check for cancelation while loading state documents

XMLWordPrintableJSON

    • Server Programmability
    • None
    • 3
    • 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.

              Assignee:
              Unassigned
              Reporter:
              Amirsaman Memaripour
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: