Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

chrisgavin
Copy link
Contributor

@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()

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

@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