Skip to content
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

Interrupted Topiary sometimes leaves lingering temporary files #843

Closed
Niols opened this issue Jan 21, 2025 · 0 comments · Fixed by #853
Closed

Interrupted Topiary sometimes leaves lingering temporary files #843

Niols opened this issue Jan 21, 2025 · 0 comments · Fixed by #853
Assignees

Comments

@Niols
Copy link
Member

Niols commented Jan 21, 2025

To Reproduce

Run Topiary and interrupt it (eg. with Ctrl+C). Sometimes, a .tmp* file remains.

Expected behavior

I would expect Topiary to clean up its current temporary file before exiting.

Environment

  • Version of the code: release 0.5.1 from nixpkgs, also main
@Xophmeister Xophmeister mentioned this issue Jan 28, 2025
2 tasks
@Xophmeister Xophmeister self-assigned this Jan 28, 2025
Xophmeister added a commit that referenced this issue Jan 28, 2025
`tempfile::NamedTempFile` cleans up when dropped, but this can be
circumvented if the destructor never runs (e.g., receiving a SIGINT
signal). `tempfile::tempfile`, however, is automatically removed by the
OS when its last file handle is closed.

Note: This required re-implementing `OutputFile::persist` to copy the
buffer contents from the staging file to the actual output.

Resolves #843
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants