ExportXMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • DB Integration & Observability
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      jstests/with_mongot/search_mocked/search_executor_shutdown_rejects_new_cursor.js (added by SERVER-135154) verifies a $search issued in the shutdown window is refused with ShutdownInProgress. The parent arms pauseBeforeShuttingDownSearchTaskExecutor, spawns the child, and blocks in MongoRunner.stopMongod(); the child waits for the fail point, runs the $search, and disables the fail point in a finally.

      Problem

      The waitForFailPoint call sits before the try:

      assert.commandWorked(
          testDb.adminCommand({waitForFailPoint: fpName, timesEntered: 1, maxTimeMS: 60000}),
      );
      
      try {
          ... assert.commandFailedWithCode(res, ErrorCodes.ShutdownInProgress);
      } finally {
          assert.commandWorked(testDb.adminCommand({configureFailPoint: fpName, mode: "off"}));
      }
      

      If the wait times out (shutdown never reaches the fail point within 60s), the assert throws before entering the try: the finally never runs, the fail point stays enabled, and when shutdown reaches it the shutdown thread blocks forever in pauseWhileSet(). The parent stays blocked in stopMongod(), so the test hangs to the resmoke/harness timeout instead of failing fast with the actual error — a masked failure that can be misread as a SERVER-129849-style shutdown hang regression.

      A pass is unaffected (the wait must succeed and the $search must fail with exactly ShutdownInProgress); only the failure path is degraded.

      Fix

      Move the waitForFailPoint call inside the try so the existing finally also disables the fail point on a wait failure.

            Assignee:
            Unassigned
            Reporter:
            Mariano Shaar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: