Skip to content

storage: export default shouldRetry function #6362

@miroslavLalev

Description

@miroslavLalev

I've recently stumbled across similar errors to #3735 and applied the proposed fix there - created a new ShouldRetry function for the storage client. However, it seems very odd that I have to copy the code from the default retry function - which also means that any additions/fixes to it will not be reflected in my code automatically. I think it would be nice to have that function exported from the storage package, so it can be used like that:

gcsClient.SetRetry(storage.WithErrorFunc(func(err error) bool {
	if storage.DefaultShouldRetry(err) { // this function comes from the storage package
		return true
	}
	return customShouldRetry(err) // my custom retry logic
}))

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions