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

wait_until(:table_not_exists… shows an error for a non existing table #3190

Open
1 task
thomaswitt opened this issue Feb 13, 2025 · 3 comments
Open
1 task
Labels
guidance Question that needs advice or information.

Comments

@thomaswitt
Copy link

Describe the bug

When I call Aws::DynamoDB::Client.new.wait_until(:table_not_exists, table_name: 'this_does_not_exist')

then I see a client error

[Aws::DynamoDB::Client 400 0.004513 0 retries] describe_table(table_name:"this_does_not_exist") Aws::DynamoDB::Errors::ResourceNotFoundException Cannot do operations on a non-existent table

IMHO this is unexpected behavior. When I tell the client to wait until a table does not exist (e.g. after a delete call) and it doesnt exist, it should just silently proceed.

Regression Issue

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

Expected Behavior

Just return nil, do not show a DynamoDB Client error

Current Behavior

Shows client error.

Reproduction Steps

Aws::DynamoDB::Client.new.wait_until(:table_not_exists, table_name: 'this_does_not_exist')

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-ruby

Environment details (Version of Ruby, OS environment)

latest, latest macOS

@thomaswitt thomaswitt added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 13, 2025
@thomaswitt thomaswitt changed the title wait_until(:table_not_exists… throws an error for a non existing table wait_until(:table_not_exists… shows an error for a non existing table Feb 13, 2025
@mullermp
Copy link
Contributor

Thanks for opening an issue. It currently returns nil as you would expect. The messaging is simply logging for the result of the call that the waiter makes. It looks for ResourceNotFoundException to determine a success state:

[1] pry(Aws)> Aws::DynamoDB::Client.new.wait_until(:table_not_exists, table_name: 'does-not-exist')
[Aws::DynamoDB::Client 400 0.360391 0 retries] describe_table(table_name:"does-not-exist") Aws::DynamoDB::Errors::ResourceNotFoundException Requested resource not found: Table: does-not-exist not found
=> nil

@mullermp mullermp added guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 13, 2025
@thomaswitt
Copy link
Author

@mullermp thanks for the answer and your time. I know that it returns the correct result, it just raises an error in my log file analyzer as it is an error (beacuse if you app throws a ResourceNotFoundException you usually want to know about that) . I simply wouldn't show this error for this function, that was my point.

@mullermp
Copy link
Contributor

You could try configuring the log formatter to not display errors for a client you use as a waiter.

I think generally the SDK should still log all calls, whether from waiters, paginators, high level libraries, etc, because those calls may charge customers and we should be transparent about what service calls are made. We could consider a matcher string for whether the call was made from a waiter that can be filtered out.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants