test(cli-repl): fix CTRL-C server-side termination tests for server 9.0 MONGOSH-3378 - #2762
Closed
nbbeeken wants to merge 3 commits into
Closed
test(cli-repl): fix CTRL-C server-side termination tests for server 9.0 MONGOSH-3378#2762nbbeeken wants to merge 3 commits into
nbbeeken wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the CLI REPL CTRL‑C integration tests to account for MongoDB Server 9.0 no longer killing in-progress operations on client disconnect (the mechanism mongosh relied on for server-side CTRL‑C termination), while adding a canary test to detect if 9.x behavior changes again.
Changes:
- Skip the existing “server >= 4.1 terminates operations on the server side” CTRL‑C termination tests when running against server
>= 9.0.0-0. - Add a new “server >= 9.0” canary test asserting that the server-side operation continues running after CTRL‑C (and then explicitly kills it via
killOpfor suite cleanup).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nbbeeken
force-pushed
the
MONGOSH-3412-ctrl-c-termination-server-9.0
branch
from
July 8, 2026 19:41
67a9b13 to
3cdf8b7
Compare
… 9.0 Server 9.0 no longer kills in-progress operations on client disconnect, the mechanism mongosh uses to terminate ops on CTRL-C. Skip the affected tests on >= 9.0 and add a canary asserting the new behavior. MONGOSH-3378 MONGOSH-3381 MONGOSH-3382 MONGOSH-3412 MONGOSH-3413
The 9.0 disconnect-kill change is isolated to server-side JavaScript: a non-JS op (nested $reduce) is still killed on client disconnect on 9.0, while a $where JS loop is not. Switch the termination tests to a non-JS op so they run and pass on all server versions (drop the >= 9.0 skip), and keep the $where-based >= 9.0 test as a canary for the JS behavior.
…pport Interrupt-on-client-disconnect coverage varies by server version and op type: $where JS loops are interrupted on 4.1-8.x but not on 9.0, while the non-JS nested-$reduce op is interrupted on 8.0+ only (CI confirmed it survives on 4.2-7.0). Run the termination tests with $where on < 8.0 and with the non-JS op on >= 8.0, so they pass on all versions, and keep the >= 9.0 canary asserting JS ops are no longer interrupted.
nbbeeken
force-pushed
the
MONGOSH-3412-ctrl-c-termination-server-9.0
branch
from
July 10, 2026 17:51
3cdf8b7 to
acdd358
Compare
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On server 9.0, in-progress operations that use server-side JavaScript (
$where) are no longer killed when the initiating client disconnects — the mechanism mongosh uses to terminate server-side operations on CTRL-C. This broke the CTRL-C termination tests onmlatest.Interrupt-on-disconnect support varies by op type and version
Verified via standalone repro + the CI matrix on this PR's earlier patch:
$whereJS loop$reduce(non-JS)(The socket really closes in all cases —
serverStatus.connections.currentdrops; what differs is whether the op's evaluation reaches an interrupt point that honors the disconnect kill.)Changes
terminates operationstests are defined once and run in two version-gated contexts: with a$whereJS loop on>= 4.1 < 8.0and with a non-JS nested-$reduceop on>= 8.0. CTRL-C termination coverage runs on all supported server versions.for server >= 9.0canary asserts server-side JS operations survive CTRL-C, pinning the 9.0 behavior change. If a future 9.x reinstates JS kill-on-disconnect, the canary fails and prompts restoring JS-based coverage.Ruled out
The recent node driver fix (NODE-7411) only affects multi-server topologies; these tests use a standalone, and the same driver shows version-dependent behavior.
No single server ticket pins the 9.0 JS regression; likely owner is Query Execution (server-side JS interrupt points) rather than Networking & Observability (whose
markKillOnClientDisconnectstill works for non-JS ops on 8.0+). Being raised with the server team.Fixes MONGOSH-3378, MONGOSH-3381, MONGOSH-3382, MONGOSH-3412, MONGOSH-3413.