Repository navigation
Conversation
The helper script recorded the grandchild's PID with $!, which is known right after fork, while the forked shell still has the TERM trap and has not yet exec'd sleep. A group SIGTERM landing in that window can be lost, so sleep keeps running and holds the output pipe until WaitDelay (the 10s grace period) and the test times out at 5s. The grandchild now writes its own PID from a fresh shell with the default TERM disposition and then execs sleep. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
✅ Integration test reportCommit: b6fdb0e
Top 6 slowest tests (at least 2 minutes):
|
This branch has not been 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.
Changes
TestBackgroundInGroupInterruptChildReadsTerminal(added in #7832) flaked on Linux with "the interrupt did not end the helper before the grace period".The helper's child script recorded the grandchild's PID with
$!, which the shell knows right afterfork. At that point the forked shell still has the TERM trap and has not yet exec'dsleep. If the group SIGTERM lands in that window it can be lost:sleep 300keeps running and holds the stdout pipe, soWaitblocks untilWaitDelay(the 10s grace period) and the test gives up at 5s. At timeout, a process dump in a local run showed theshchild gone andsleep 300still alive, reparented.The grandchild now writes its own PID (
$$) from a freshly exec'd shell, which has the default TERM disposition, and thenexecssleep. Once the PID is recorded, a SIGTERM always ends it. The test checks the same things as before.The production code is unchanged. The other tests in the package that use
$!don't catch TERM: they either leave the default disposition or ignore TERM, and an ignored disposition survivesforkandexec.Tests
-race -count=40locally, 13 failures with the same message.withNewSessionis disabled (child left in the terminal's session), so it still catches the SIGTTIN regression it was written for.Dashboard: error/3824, libs/process.TestBackgroundInGroupInterruptChildReadsTerminal. Flaky on PRs: 3+ failures in 7 days (to 2026-11-25), for example:
This pull request and its description were written by Isaac.