-
Notifications
You must be signed in to change notification settings - Fork 0
Fix Container Shutdown Race Condition #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
chris-sanders
added a commit
that referenced
this pull request
Jul 29, 2025
- fix-container-name-conflicts.md (PR #46 merged) - fix-asyncio-transport-python313.md (PR #42 merged) - fix-container-shutdown-race-condition.md (PR #41 merged) - fix-transport-cleanup-and-curl-dependency.md (PR #40 merged) - implement-comprehensive-testing-improvements.md (PR #39 merged) - switch-to-melange-apko-build.md (completed previously)
chris-sanders
added a commit
that referenced
this pull request
Aug 11, 2025
* Fix signal handler race condition by removing sys.exit() * Add comprehensive integration and e2e tests for signal handling * Fix tests and update race condition test to verify fix * Fix e2e test stdin handling * Fix code formatting * Fix platform-specific exit codes in signal handling tests * Fix formatting * Make signal handling tests more lenient for CI environments
chris-sanders
added a commit
that referenced
this pull request
Aug 11, 2025
- fix-container-name-conflicts.md (PR #46 merged) - fix-asyncio-transport-python313.md (PR #42 merged) - fix-container-shutdown-race-condition.md (PR #41 merged) - fix-transport-cleanup-and-curl-dependency.md (PR #40 merged) - implement-comprehensive-testing-improvements.md (PR #39 merged) - switch-to-melange-apko-build.md (completed previously)
chris-sanders
added a commit
that referenced
this pull request
Aug 11, 2025
* Fix signal handler race condition by removing sys.exit() * Add comprehensive integration and e2e tests for signal handling * Fix tests and update race condition test to verify fix * Fix e2e test stdin handling * Fix code formatting * Fix platform-specific exit codes in signal handling tests * Fix formatting * Make signal handling tests more lenient for CI environments
chris-sanders
added a commit
that referenced
this pull request
Aug 11, 2025
- fix-container-name-conflicts.md (PR #46 merged) - fix-asyncio-transport-python313.md (PR #42 merged) - fix-container-shutdown-race-condition.md (PR #41 merged) - fix-transport-cleanup-and-curl-dependency.md (PR #40 merged) - implement-comprehensive-testing-improvements.md (PR #39 merged) - switch-to-melange-apko-build.md (completed previously)
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
sys.exit(0)
from signal handlerProblem
Container shutdown was failing with:
Solution
The race condition was caused by calling
sys.exit(0)
in the signal handler while logging operations were still in progress. The fix:sys.exit(0)
from the signal handler_shutdown_requested
flag that the main loop can checkTest Plan