Skip to content

Add some release asset upload retrying. #74

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

Merged
merged 2 commits into from
Jun 14, 2022
Merged

Add some release asset upload retrying. #74

merged 2 commits into from
Jun 14, 2022

Conversation

chrisgavin
Copy link
Collaborator

@chrisgavin chrisgavin commented May 30, 2022

This hopefully improves the success rate of uploading to the integration test instance.

We retry on 5xx errors, and handle already_exists errors explicitly. The reason for handling `already_exists is that it seems like sometimes the "failed upload" from a 5xx error will actually finish successfully in the background so if we retry again we'll get a 422 due to uploading a duplicate asset.

@chrisgavin chrisgavin force-pushed the upload-retrying branch 11 times, most recently from 127bc30 to 38c5894 Compare May 31, 2022 10:06
@chrisgavin chrisgavin marked this pull request as ready for review June 14, 2022 13:46
if err != nil {
return errors.Wrap(err, "Error opening release asset.")
}
defer assetFile.Close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think defering inside a for loop might cause a resource leak here? If so, you might have to move this block into a function.

Copy link
Contributor

@simon-engledew simon-engledew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, although I've not tested it out. 🙏

@chrisgavin chrisgavin merged commit 0de4ed4 into main Jun 14, 2022
@chrisgavin chrisgavin deleted the upload-retrying branch June 14, 2022 14:42
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.

2 participants