Skip to content

Keep crash-log streams open until fault handling stops - #3

Merged
ctoth merged 1 commit into
masterfrom
improve/crash-lifetime
Oct 29, 2026
Merged

ctoth merged 1 commit into
masterfrom
improve/crash-lifetime

Conversation

@ctoth

@ctoth ctoth commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@ctoth
ctoth force-pushed the improve/crash-lifetime branch from 719bf0b to ecc6e28 Compare October 29, 2026 18:31
@ctoth
ctoth changed the base branch from improve/utf8-logs to master October 29, 2026 18:31
@ctoth
ctoth merged commit 51e24f1 into master Oct 29, 2026
1 of 2 checks passed
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.

1 participant