Skip to content

Remove temporary files after interrupted atomic saves - #63

Open
OskarEichler wants to merge 2 commits into
ruby:masterfrom
OskarEichler:codex/cleanup-interrupted-atomic-save
Open

Remove temporary files after interrupted atomic saves#63
OskarEichler wants to merge 2 commits into
ruby:masterfrom
OskarEichler:codex/cleanup-interrupted-atomic-save

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Delete the temporary file when an atomic save raises Interrupt or another Exception outside StandardError, while preserving the original failure and store contents.

Reproduction and verification

Injected IOError and Interrupt during temporary-file writes. Both must propagate, leave the old store value intact and remove temporary files. Existing code leaves a temporary file behind for Interrupt.

  • External focused corpus: 6 verified on this isolated branch under rbenv Ruby 4.0.6.
  • Existing upstream RBENV_VERSION=4.0.6 rbenv exec rake test: 13 tests / 26 assertions, zero failures before and after.
  • All files and injected failures are confined to scratch storage; no production operations.
  • No repository tests added or modified under the contributor's task constraint. Other Ruby versions and native Windows were not executed locally.

Breaking-change notes and limitations

No normal-output or format change. Cleanup is attempted before propagating the exception. No guarantee is made for process termination, power loss or arbitrary asynchronous termination at every instruction.

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