[SERVER-30174] Ensure all DocumentSource::getNext() implementations check for interrupt Created: 17/Jul/17  Updated: 30/Oct/23  Resolved: 28/Jul/17

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.5.11

Type: Task Priority: Major - P3
Reporter: Charlie Swanson Assignee: Martin Neupauer
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2017-07-31
Participants:

 Description   

Each implementation of the DocumentSource interface must override DocumentSource::getNext(), and any implementation of this method is required to check for interrupt during execution. This part of the contract is not enforced, so of course there are at least a few stages that do not follow it, such as $currentOp and $collStats.

We should at least fix these two (and any others that are missing it), and consider making this contract enforceable, either through a test or through a non-virtual getNext() and a virtualized doGetNext() as we do for PlanStage::work() and PlanStage::doWork().



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

Author:

{'email': 'martin.neupauer@mongodb.com', 'name': 'Martin Neupauer'}

Message: SERVER-30174 Add a check for interrupts.

Add the checks to few missing places.
Branch: master
https://github.com/mongodb/mongo/commit/e2249895cdb317c6fe466aaadd76d3e5b31bfcda

Generated at Thu Feb 08 04:22:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.