Repository navigation
fix(upstream): hard-kill launcher group when Stop gives up (#1614) - #1629
Merged
Merged
Conversation
…ndant is not orphaned (#1614) stopLauncher and the wait-for-url cleanup call handle.Kill() after a Stop error. Handle.Kill signals the recorded group only while the leader is unreaped, so a reused group number is never hit. Adds a regression test for a launcher that backgrounds a TERM-immune child and exits first.
Deploying mcpproxy-docs with
|
| Latest commit: |
ecca24f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ebdaadf8.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-1614-launcher-teardown.mcpproxy-docs.pages.dev |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 38895429277 --repo smart-mcp-proxy/mcpproxy-go
|
Dumbris
added a commit
that referenced
this pull request
Oct 17, 2026
…nts (#1637) ## Root cause `TestConfigWatcher_ExternalRevertToLastSelfWriteReloads` flaked on macOS-15 runners (#1629, #1634). It is not a self-write-marker bug: with debug instrumentation under CPU load (reproduced ~1 in 100-250 runs locally on macOS), the final external revert to byte-identical A produced **no fsnotify event at all** after B's reload, so no debounce fired and the config stayed on B. fsnotify's kqueue backend can drop the event for a rename-over that follows a recently handled one. This is a real production hole (an external edit can be silently missed until restart), not only a test timing issue. ## Fix `runConfigWatchLoop` now also polls (2s) and compares file bytes with the last evaluated content; on a difference it arms the normal debounce -> `reloadFromDiskIfChanged` path, so self-write suppression is unchanged. The poll does not re-arm a pending debounce. ## Tests - New `TestConfigWatcher_PollRecoversMissedFsEvent` deterministically simulates total event loss (watch on an unrelated dir) and fails without the poll. - Before: 2 failures in ~120 runs, 1 in 250 (12 CPU spinners + 10 parallel test processes). After: 0 failures in 100 runs of the whole `TestConfigWatcher_` suite under the same load, plus 20 clean sequential `-race` runs. - golangci-lint (bare and `--build-tags server`) on `internal/runtime`: only a pre-existing `reflect.Ptr` inline finding in `event_bus.go`, untouched here.
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.
Summary
Issue #1614: a launcher that backgrounds a long-lived descendant and exits first could leave that descendant running after teardown.
Finding: on current main the launcher layer already covers the common case (Spec 116 PR4 review round 6 keeps the exited leader unreaped while a group member runs, so
Stopstill signals the group). The remaining gap isStopgiving up early (expired context) with the group still up.stopLauncherand the wait-for-url failure cleanup now callhandle.Kill()after aStoperror.Killsignals the recorded group only while the leader is unreaped, so a reused group number is never hit.Adds
TestStopLauncher_LeaderExitedFirst_KillsDescendant(TERM-immune backgrounded child, launcher exits first, expired Stop context). Note: this test already passed before the change on main (the launcher layer handles it), so it is a regression guard rather than a failing-first test.Tests
go test -race ./internal/upstream/core ./internal/upstream/launcherpassesGOOS=windows go veton both packages passes--build-tags server): only a pre-existing govet finding inclient_secret_test.goCloses #1614