-
Type: Question
-
Resolution: Gone away
-
Priority: Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
I was chatting with max.hirschhorn today about how to properly use a Pipeline across different OperationContexts to ensure that the Pipeline is destroyed before the OperationContext. I noticed that $lookup and $unionWith have different handling for how they do this - which led me to question which one is superior or if there's a good reason for the difference.
In $lookup, we manually take control over the sub-pipeline disposal, as you can see here. In $unionWith, we don't do that, but we do have a similar cleanup block in doDispose(), just like $lookup. It seems like maybe we should dismissDisposal for $unionWith, and that this might simplify some of the code which is trying to preserve information like the explain plan?
I think it might be worth an investigation if no one has an easy answer about this.