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

Pipeline::dispose() should not check for stale databaseVersion

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Query
    • ALL
    • 17

      As part of cleaning up the execution machinery for an aggregation cursor, Pipeline::dispose() must be called before calling the Pipeline destructor. For exception safety, we use a std::unique_ptr Deleter to ensure that Pipeline::dispose() is called whenever an error occurs.

      This implies Pipeline::dispose() cannot throw, since it may be called when an exception is already active. However, DocumentSourceCursor::doDispose() constructs an AutoGetDb. AutoGetDb can throw an exception on construction due to stale databaseVersion. Since we don't attach a databaseVersion for aggregate commands, we have only ever observed this scenario for explain of an aggregate command. Still, skipping the stale databaseVersion check in the disposal process would ensure that we never run into a double-exception bug.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: