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

Added --error-retry store option to retry network errors #202

Merged
merged 1 commit into from
Dec 12, 2021

Conversation

tanshihaj
Copy link
Contributor

Currently when downloading chunks from s3 store over unreliable network, TCP session can fall apart and server will begin to send RST package. And because of that commands that work with s3 store fails. That would be great to have and option to retry download in case of network error.

We already have ErrorRetry entry in StoreOptions, in this commit I'm adding --error-retry cli option that overrides ErrorRetry from configs. Also I think that there is bug with retry here https://github.com/folbricht/desync/blob/master/s3.go#L97-L99: GetObject() will return error only when object or bucket name is invalid and retry will no fix it. At the same time we ignore network errors that can raise during ioutil.ReadAll https://github.com/folbricht/desync/blob/master/s3.go#L104 that can be fixed with retry.

@tanshihaj
Copy link
Contributor Author

Maybe it is also good idea to set some non-zero default value (about 3) for --error-retry

s3.go Show resolved Hide resolved
s3.go Outdated Show resolved Hide resolved
s3_test.go Show resolved Hide resolved
s3_test.go Show resolved Hide resolved
s3_test.go Show resolved Hide resolved
s3_test.go Outdated Show resolved Hide resolved
s3_test.go Show resolved Hide resolved
Copy link
Owner

@folbricht folbricht left a comment

Choose a reason for hiding this comment

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

Thank you

@folbricht folbricht merged commit eeffcfc into folbricht:master Dec 12, 2021
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