Download to temp file and rename atomically in download_file#792
Merged
bhearsum merged 2 commits intomozilla-releng:mainfrom Apr 27, 2026
Merged
Download to temp file and rename atomically in download_file#792bhearsum merged 2 commits intomozilla-releng:mainfrom
bhearsum merged 2 commits intomozilla-releng:mainfrom
Conversation
Instead of downloading to the final file, download to a temporary file then move the file into place. This prevents two different coroutines from writing chunks one after another into the same file. This feels a bit like a bandaid for something that shouldn't happen in the first place (we shouldn't be trying to download the same file twice) but it's a safe patch for a problem that is very real anyway as a failure would leave a corrupted file on the system right now and any retry would just see that and fail later on. I intend on fixing the fact that we are downloading the same file multiple times in a follow up by caching the coroutine instead but this is a worthwhile fix anyway
E203 (whitespace before ':') conflicts with black's slice formatting. The black documentation mentions this at https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#e203 and is saying we should disable that rule in flake8. I think we should switch to ruff instead and get rid of those 79 tools we have that do the same thing slightly differently but that's a problem for another day
bhearsum
approved these changes
Apr 27, 2026
Contributor
bhearsum
left a comment
There was a problem hiding this comment.
wfm as a short term fix
bhearsum
added a commit
to mozilla-releng/scriptworker-scripts
that referenced
this pull request
Apr 27, 2026
This picks up mozilla-releng/scriptworker#792, which fixes a regression from 63.0.0
This was referenced Apr 28, 2026
bhearsum
added a commit
to mozilla-platform-ops/ronin_puppet
that referenced
this pull request
Apr 28, 2026
This will pick up a new scriptworker version to pick up mozilla-releng/scriptworker#792, which fixes some CoT verification errors.
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.
Instead of downloading to the final file, download to a temporary file then move the file into place. This prevents two different coroutines rom writing chunks one after another into the same file. This feels a bit like a bandaid for something that shouldn't happen in the first place (we shouldn't be trying to download the same file twice) but it's a safe patch for a problem that is very real anyway as a failure would leave a corrupted file on the system right now and any retry would just see that and fail later on.
I intend on fixing the fact that we are downloading the same file multiple times in a follow up by caching the coroutine instead but this is a worthwhile fix anyway