Repository navigation
test(run): re-sample main's signal mask past the posix_spawn window (LAB-11681) - #41
Merged
Merged
Conversation
Spawning the command through glibc's posix_spawn blocks every signal on the calling thread until the child execs. The command can record its run before ck's main thread is scheduled again, so a single read of main's SigBlk under CPU load caught that transient mask and failed. Re-sample main's mask for up to 2 s and fail only if a handled signal stays blocked; the message now prints the observed mask. The command sleeps 5 s so ck outlives the re-sample.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
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.
helper_threads_block_the_handled_signalsfailed intermittently under CPU load with "the main thread blocks a handled signal". The race is in the test, not in ck:std::process::Command::spawnuses glibc'sposix_spawn, which blocks every signal on the calling thread until the child execs. The command can record its run before ck's main thread is scheduled again, so the test's single read of main'sSigBlkcould land inside that window. A signal sent then stays pending and is delivered when glibc restores the mask, so nothing is lost.Change (
tests/run.rs, test only)SigBlkevery 5 ms for up to 2 s, and fail only if a handled signal (HUP, INT, QUIT, TERM) stays blocked.SigBlk 0000000000004000.Verification
60 isolated runs of the one test, pinned to one CPU beside three busy loops:
Checks (local, as CI runs them)
cargo fmt --all -- --check: passcargo clippy --locked --all-targets -- -D warnings: passcargo test --locked: lib 22, readme 1, run 45, saas 17 passed; bench 1 ignored; 0 failedNo docs change: test-only, no user-facing behaviour.
Closes LAB-11681