Skip to content

main-breakage: mcpx examples suite leaks supervise processes — nix checkPhase fails, amd toplevel blocked #10853

Closed

Description

@dezren39

main-breakage: mcpx examples suite leaks supervise processes — nix checkPhase fails, amd toplevel build blocked

Found by lane any-b, task 17502 (2026-11-16), while trying to build-verify PR #10817 (nixpkgs-update 2026-11-16) for darwin-nix#1913.

Symptom

pkgs/mcpx's nix build fails its checkPhase: every test passes, but the examples package fails the testsupport process sweep (#1971):

testsupport: 8 process(es) still executing from the suite's build temp dirs after the suite ran (#1971)
FAIL github.com/developing-today/code/pkgs/mcpx/examples 66-86s

8 survivors = 4 example daemons' worth. Inspection of a survivor shows it is not the daemon itself but its server supervisor:

/tmp/mcpx-bin-<tmp>/mcpx supervise --socket /tmp/TestExamplesdiscover<...>/001/state/sup-2a97516c354b6884.sock -- /tmp/mcpx-fake-<tmp>/fakemcp

still alive 38s+ after the test suite ended (the sweep polls a 10s shutdown budget before declaring a leak). The example's own cleanup (mcpx stop --all, t.Cleanup in examples_test.go) exits without error, yet the supervise process and its fakemcp child survive. Supervise processes from e2e subset runs were likewise still alive an hour later on the laptop.

Reproduction (no nix involved)

On current main (95ef2ba):

cd pkgs/mcpx && go test ./examples/ -count=1
# PASS for every test, then:
# testsupport: 8 process(es) still executing ... FAIL

A single subtest reproduces it: go test ./examples/ -run 'TestExamples/discover' -count=1 -v — test PASSes, 2 survivors (1 supervise + 1 fakemcp).

Impact

  • nix build .#nixosConfigurations.amd.config.system.build.toplevel fails on the mcpx derivation (builder exit 1) — verified in 3 full attempts on PR chore(deps): nixpkgs update 2026-11-16 #10817's branch (which has current main merged) on 2026-11-16; the mcpx derivation was the ONLY failing dependency (full-log + --keep-going runs; logs at ~/git/fleet/17502-build-full.log and 17502-build-retry.log on the laptop).
  • This blocks PR chore(deps): nixpkgs update 2026-11-16 #10817 (nixpkgs-update 2026-11-16) and therefore darwin-nix#1913 / queue task 17502, which is dep-blocked on this issue.
  • A second, load-sensitive failure was seen once under load ~30 (internal/pool TestDefaultConfigStdioRunsSupervised: "supervised child still alive after the reap") — same supervise-reap family; it passed at low load. The examples leak reproduces at load ~1.5, so it is not a load flake.

Suspected area

The supervise lifecycle: a mcpx supervise parent for a supervised stdio server (fakemcp here) is not reaped when the owning command/daemon stops. Either stop --all does not signal supervisors, or the supervisor ignores the daemon's shutdown. The #1971 sweep (commits 6599706, ff4b38a, 7beef75) is doing its job — the leak is real.

Acceptance

  • go test ./examples/ -count=1 exits 0 with no surviving supervise/fakemcp processes after the suite.
  • The mcpx nix derivation builds green and the amd toplevel build completes on PR chore(deps): nixpkgs update 2026-11-16 #10817's branch.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    on Nov 16, 2026
  2. developing-today commented on Nov 16, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: pr_opened (task 17545, lane any-b)
    Fix: PR #10857 — examples cleanup now terminates the test's supervisors (mcpclient.TerminateSupervisorSocket over the state dir's sup-*.sock, with retry while the daemon detaches) after mcpx stop --all. Production supervisor semantics unchanged (survive daemon restart where reattach is possible); the suite's throwaway state dir has no reattacher, so the suite reaps its own.
    Verified: go test ./examples/ -count=1 ok 52.97s (was: all tests pass + sweep FAIL, 8 survivors); nix build .#mcpx NIX_EXIT=0 with full checkPhase (was builder exit 1). On merge + issue close, task 17502 (dep-blocked on this issue) returns to the pool to rebuild/merge PR #10817.

  4. added a commit that references this issue on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working (prefixed form of the classic bug label)status:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions