Skip to content

Clean up partial remote package artifact downloads on failure#289

Merged
GrahamCampbell merged 1 commit into
4.xfrom
fix-partial-remote-artifact-download-cleanup
Jun 6, 2026
Merged

Clean up partial remote package artifact downloads on failure#289
GrahamCampbell merged 1 commit into
4.xfrom
fix-partial-remote-artifact-download-cleanup

Conversation

@GrahamCampbell
Copy link
Copy Markdown
Contributor

Remote S3 package artifact downloads could leave a partially written temp file behind when the download or the destination write stream failed, because the streamed write to disk was not wrapped in any cleanup. This wraps that write so that a failed download or write removes the partial temp file before re-throwing the original error, and it ignores any cleanup error so cleanup never masks the underlying download or write failure. It also adds unit tests covering removal of the partial temp file on failure, a missing temp file being ignored during cleanup, and a cleanup failure not masking the original error.

Fixes #220.

@GrahamCampbell GrahamCampbell merged commit a708428 into 4.x Jun 6, 2026
8 checks passed
@GrahamCampbell GrahamCampbell deleted the fix-partial-remote-artifact-download-cleanup branch June 6, 2026 22:04
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