Skip to content

Fix SIGINT handling: re-raise signal instead of exit(130) #13589

Open
4RH1T3CT0R7 wants to merge 4 commits intodocker:mainfrom
4RH1T3CT0R7:main
Open

Fix SIGINT handling: re-raise signal instead of exit(130) #13589
4RH1T3CT0R7 wants to merge 4 commits intodocker:mainfrom
4RH1T3CT0R7:main

Conversation

@4RH1T3CT0R7
Copy link

@4RH1T3CT0R7 4RH1T3CT0R7 commented Feb 13, 2026

  • Fix docker compose pull (and all other commands) to properly re-raise SIGINT/SIGTERM after cleanup instead of exiting with code 130. This ensures parent processes see WIFSIGNALED=true via waitpid(), enabling correct WCE (Wait and Cooperative Exit) shell propagation.
  • Propagate context cancellation error from pullServiceImage instead of swallowing it, so concurrent pulls stop immediately on Ctrl+C.

Problem

When a user presses Ctrl+C during docker compose pull, the process exits via os.Exit(130). The parent shell's waitpid() sees WIFEXITED=true (normal exit), not WIFSIGNALED=true (signal death). This breaks shell script interrupt handling — the parent script continues executing instead of stopping.

Fixes #13586

@4RH1T3CT0R7 4RH1T3CT0R7 requested a review from a team as a code owner February 13, 2026 00:21
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
ndeloof
ndeloof previously approved these changes Mar 10, 2026
4RH1T3CT0R7 and others added 2 commits March 14, 2026 17:28
Since up_test.go has a !windows build constraint, the process will
always die from the re-raised signal on this platform. Remove the
fallback to exit code 130 and assert -1 directly.

Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
@4RH1T3CT0R7
Copy link
Author

@ndeloof Good point! Since up_test.go already has a //go:build !windows constraint, the process will always die from the re-raised signal on this platform. Simplified the assertion to expect exactly -1 instead of == -1 || == 130. Thanks for the review!

@ndeloof ndeloof enabled auto-merge (rebase) March 14, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] "pull" doesn't exit on SIGINT correctly

2 participants