Repository navigation
Keep crash-log streams open until fault handling stops - #3
Merged
Merged
Conversation
ctoth
force-pushed
the
improve/crash-lifetime
branch
from
October 29, 2026 18:31
719bf0b to
ecc6e28
Compare
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.
Goal
Keep fatal traceback output attached to an open error-log stream through shutdown.
State
Pass the existing error-handler stream directly to faulthandler. Remove the wrapper that only forwarded fileno. Package shutdown and an exit callback disable package-enabled fault handling before logging closes its files. This PR is independently based on integrated master and contains no UTF-8 PR commits.
Decisions and why
faulthandler retains a file descriptor, not a logging handler. Its stream must stay open until fault handling is disabled. The exit callback runs before logging's earlier registered shutdown callback. Disabling is a no-op when this package has not enabled fault handling. Fatal dumps remain raw output rather than formatted log records.
Surprises
The removed StreamToLogger never redirected log writes; its description was misleading.
Next step
Read this PR's existing package checks. Subsequent setup/reconfiguration changes must retain the same file-lifetime ordering. No merge or release.