-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework, Performance
-
None
-
Fully Compatible
-
v3.6
-
Query 2017-12-18
-
0
In order to dispose of a PlanExecutor, we need to acquire the collection lock to avoid races upon deregistering the PlanExecutor from the CursorManager. However, in the case where the PlanExecutor has been exhausted or the limit has been reached (this case) we end up releasing the lock directly before re-acquiring it to dispose of the PlanExecutor. We should simply dispose of the PlanExecutor while we still hold the lock.