Skip to content

dynamodb.TableExistsWaiter won't wait if waitTime < minDelay  #2551

Closed as not planned
@mmunoz3

Description

Acknowledgements

Describe the bug

The table waiter won't wait at all when passed waitTime < MinDelay.

So to get any wait time smaller than the default 20 seconds stablished for MinDelay the caller is forced to set this MinDelay optional parameter to something smaller than the wanted waitTime:

Expected Behavior

The waiter should wait for waitTime without having to worry about the MinDelay optional parameter.

Current Behavior

The waiter performs the check :

if remainingTime < options.MinDelay || remainingTime <= 0 {
	break
}

Deciding it doesn't have to wait as if it were in the middle of the computational backoff and returning the error.

Reproduction Steps

	ctx := context.Background()

	conf, _ := config.LoadDefaultConfig(ctx)

	client := dynamodb.NewFromConfig(conf)

	waiter := dynamodb.NewTableExistsWaiter(client)

	waitTime := 10 * time.Second

	err := waiter.Wait(ctx, &dynamodb.DescribeTableInput{
		TableName: aws.String("myTable"),
	}, waitTime)

Possible Solution

Implement some logic like: "if this is the first wait and remainingTime < minDelay then wait remainingTime"

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2/service/dynamodb v1.27.1

Compiler and Version used

go version go1.21.5 darwin/arm64

Operating System and version

MacOS Sonoma

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugThis issue is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions