AsyncResultsMerger retry callback calls _cleanUpKilledBatch with wrong lifecycle state, causing tassert

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Problem

      The getAsync retry callback in AsyncResultsMerger::_handleBatchResponse unconditionally calls _cleanUpKilledBatch whenever _lifecycleState != kAlive !_status.isOK() (while lifecycle is still kAlive), or when lifecycle is kKillComplete, the tassert fires.

      // src/mongo/s/query/exec/async_results_merger.cpp, inside the getAsync retry callback
      >;if (self->_lifecycleState != kAlive || !self->_status.isOK()) {
      remote->outstandingRequest = false;
      self->_signalCurrentEventIfReady(lk);
      self->_cleanUpKilledBatch(lk);  // tasserts: _lifecycleState != kKillStarted
      return;
      }

      Fix

      Guard _cleanUpKilledBatch so it only runs when _lifecycleState == kKillStarted

            Assignee:
            Unassigned
            Reporter:
            Blake Oler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: