Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-56381

Investigate OpCtx & dispose() mechanism in $unionWith

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Gone away
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            charlie.swanson Charlie Swanson
            Reporter:
            charlie.swanson Charlie Swanson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: