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

Unexpected behavior from waiter if timeout provided #5838

Open
1 task
oleg-rd opened this issue Jan 29, 2025 · 1 comment
Open
1 task

Unexpected behavior from waiter if timeout provided #5838

oleg-rd opened this issue Jan 29, 2025 · 1 comment
Assignees
Labels
documentation This is a problem with documentation. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.

Comments

@oleg-rd
Copy link

oleg-rd commented Jan 29, 2025

Describe the bug

Based on the documentation it is possible to override the default configuration of the waiter. One of the example demonstrates the option to provide custom timeout - o.waitTimeout(Duration.ofMinutes(1)). So the expectation in this case that overall amount of time that waiter is going to be waiting should be based on that provided timeout. However, waiter could be stopped earlier if it reaches maxAttempts, that defaults to 100.

For example, if we set waitTimeout as Duration.ofMinutes(30) - it won't work like that. Waiter will be stopped after 10 minutes, because it has 100 attempts and 6s between them provided by default.

Regression Issue

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

Expected Behavior

Either skip maxAttempts (do not set it as default = 100) or recalculate it in runtime based on provided timeout if overridden configuration provided

Current Behavior

Waiter with overridden configuration doesn't work as expected

Reproduction Steps

        WaiterOverrideConfiguration waiterOverrideConfiguration = WaiterOverrideConfiguration.builder()
                .waitTimeout(Duration.ofSeconds(30))
                .build();

Possible Solution

If the described behavior considered as valid and expected, please at least update the documentation to mention this as it is really confusing at the moment. However, I still consider not convenient to force users to recalculate amount of attempts manually if they just want to focus on timeout.

Additional Information/Context

No response

AWS Java SDK version used

2.29.43

JDK version used

11

Operating System and version

Windows 10

@oleg-rd oleg-rd added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 29, 2025
@bhoradc bhoradc added needs-reproduction This issue needs reproduction. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 29, 2025
@bhoradc bhoradc self-assigned this Jan 29, 2025
@bhoradc
Copy link

bhoradc commented Jan 31, 2025

Hi @oleg-rd,

Thank you for reporting the issue. I am unsure which service waiter you are trying to use here. But irrespective of that, the default values are coming from the respective AWS services. For reference - DynamoDB service waiters.

The WaiterOverrideConfiguration is indeed intended to allow users to override the default configurations, but it does not automatically adjust other related parameters. When you override the waitTimeout parameter, the maxAttempts value remains at its default unless explicitly overridden as well. To correctly override the waiter behavior, you would need to explicitly set all relevant parameters when deviating from the service defaults.

By documentation improvement, are you referring to the "Override configuration for a specific request" section, where an example with waitTimeout is shown without overriding the maxAttempts?

Regards,
Chaitanya

@bhoradc bhoradc added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. documentation This is a problem with documentation. and removed bug This issue is a bug. needs-reproduction This issue needs reproduction. labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Projects
None yet
Development

No branches or pull requests

2 participants