Repository navigation
fix: add opt-in proxy SIGTERM forwarding (4.3.2) - #1076
Closed
leoafarias wants to merge 7 commits into
Closed
leoafarias wants to merge 7 commits into
leoafarias wants to merge 7 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
leoafarias
marked this pull request as draft
September 10, 2026 19:57
leoafarias
marked this pull request as ready for review
September 10, 2026 20:33
Prove that forwarding resolves the executable through the supplied PATH without a shell, that a missing executable then raises ProcessException, and that the default shell launch still exits 127. Document the exit status change for the forwarding mode.
leoafarias
commented
Sep 30, 2026
Collaborator
Author
There was a problem hiding this comment.
Verdict: OK to merge. Making SIGTERM forwarding opt-in is the right call, and the system-PATH fallback fix is the most valuable part of this PR.
Checked claims
- Forwarding by default would be harmful.
test_core0.6.8 (lib/src/executable.dart,completeShutdown) cancels its signal subscription on the first SIGINT/SIGTERM. A second SIGTERM then hits Dart's default handler and killsdart testbeforerunner.close()finishes. When a runner kills the whole process group (systemdKillMode=control-group,kill -TERM -pgid), forwarding would deliver that second signal. Keeping it opt-in avoids this, similar to howtinionly signals the group when you pass-g. - The fallback is broken on
main. I compiled both revisions and ran them with a fakeflutteronPATH, no pinned or global version, and an isolatedHOME/FVM_CACHE_PATH:main:fvm flutter --versionprints nothing (exit 0). With the child exiting 3, the output only appears inside aProcessExceptiondump.- this PR: output streams live, and the exit status passes through (0 and 3).
This affects everyfvm flutter/fvm dart/fvm execcall outside a pinned project, so it's worth highlighting in the 4.3.2 notes.
- The code covers the start-up race (a signal arriving while
Process.startis pending), cancels the subscriptions infinally, skips Windows, and exits 143.
Nits (optional)
context.environment['FVM_FORWARD_SIGTERM'] == 'true'is case-sensitive.FVM_USE_GIT_CACHEgoes throughstringToBool(case-insensitive), soFVM_FORWARD_SIGTERM=TRUEis silently ignored. UsingstringToBool(... ?? '') == truewould make them consistent.- No caller passes
runInShell(it didn't onmaineither). Thebool?parameter could be dropped and the launch mode computed fromforwardSigtermalone, leaving one less option to keep documented.
Scope note: the SIGTERM handler is only active while an echoed child is running. A SIGTERM during install/setup (which uses Process.run) still ends FVM immediately. That's fine for this PR, and the docs already say FVM doesn't supervise every descendant.
Resolve the pubspec.yaml conflict with the btwld migration (#1078): keep version 4.3.2 from this branch and the new btwld homepage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011SmK6LGRTwTTAD1GQuMw4q
This branch was successfully deployed
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
Prepare 4.3.2 with opt-in PID-only cancellation:
FVM_FORWARD_SIGTERM=trueforwards SIGTERM to a POSIX proxy child, waits for cleanup, and exits 143. Default process-group cancellation and shell behavior remain unchanged, avoiding duplicate signals that can interrupt cleanup. Enable this per invocation only when the runner signals FVM's PID.Also restore live stdin/stdout/stderr and normal child status for system-PATH fallback. Terminal Ctrl+C remains supported; arbitrary descendant supervision and parent-death detection are outside this change. Related to #1046.
Validation
Independent compiled-CLI reproductions verify opt-in PID cancellation and default group cancellation each deliver one signal and finish child cleanup.
New group regressions fail against the automatic-forwarding revision and pass with this fix. Tests cover direct/fallback paths, live stdio, exit status, and terminal Ctrl+C; Windows runs the normal-exit cases.
511 non-SDK tests, the 461-test CI selection, Dart analysis, DCM, isolated manual smoke, and repository hooks passed locally. Tests use
GIT_CONFIG_NOSYSTEM=1for existing Apple Git fixture compatibility.All nine platform, integration, and migration CI jobs passed on
75dbc088.Follow-up commit adds
test/src/services/process_service_posix_launch_test.dart, pinning that forwarding mode resolves the executable through the suppliedPATHwithout a shell, surfaces a missing executable asProcessException(exit 2), and that the default shell launch still exits 127. Docs and changelog note the exit-status difference.