Skip to content

waiters always retry on error, regardless of type #2937

Closed
@goro9

Description

@goro9

Acknowledgements

Describe the bug

It seems that the ObjectExistsStateRetryable used by default in NewObjectExistsWaiter is being retried for errors other than NotFound.

func objectExistsStateRetryable(ctx context.Context, input *HeadObjectInput, output *HeadObjectOutput, err error) (bool, error) {
if err == nil {
return false, nil
}
if err != nil {
var errorType *types.NotFound
if errors.As(err, &errorType) {
return true, nil
}
}
return true, nil
}

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

For NotFound errors: retry HeadObject
For errors other than NotFound: return err as is

Current Behavior

Always retry when an error occurs, regardless of the error type.

Reproduction Steps

options.Retryable = func(_ context.Context, _ *s3.HeadObjectInput, _ *s3.HeadObjectOutput, err error) (bool, error) {
	if err == nil {
		return false, nil
	}

	var errorType *types.NotFound
	if errors.As(err, &errorType) {
		return true, nil
	}

	return false, err
}

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

	github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1

Compiler and Version used

go version go1.23.4 darwin/arm64

Operating System and version

macOS Sonoma 14.1

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p1This is a high priority issuequeuedThis issues is on the AWS team's backlog

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions