Skip to content

docs: clarify waitTimeout Javadoc for WaiterOverrideConfiguration - #7292

Merged
bhoradc merged 5 commits into
masterfrom
bhoradc/fix-waitTimeout-javadoc-5838
Aug 20, 2026
Merged

docs: clarify waitTimeout Javadoc for WaiterOverrideConfiguration#7292
bhoradc merged 5 commits into
masterfrom
bhoradc/fix-waitTimeout-javadoc-5838

Conversation

@bhoradc

@bhoradc bhoradc commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Issue #5838 reported that setting WaiterOverrideConfiguration.waitTimeout(Duration.ofMinutes(30)) on the ECS TasksRunning waiter did not produce a 30-minute wait — the waiter terminated at ~10 minutes with "The waiter has exceeded the max retry attempts: 100".

This is the as-designed behavior: waitTimeout and maxAttempts are independent limits, and whichever is reached first transitions the waiter to a failure state. For the ECS TasksRunning service defaults (delay=6s, maxAttempts=100), the total service-default wait budget is ~10 minutes, so a longer waitTimeout cannot extend past that ceiling — the maxAttempts limit fires first.

The confusion stems from the current Javadoc not documenting this interaction. Customers reasonably assume waitTimeout is a primary "how long to wait" knob when it is actually an optional cap that operates alongside the service-provided default maxAttempts.

Related to #5838.

Modifications

Doc-only edit to WaiterOverrideConfiguration.Builder#waitTimeout(Duration). Adds a paragraph that:

  • Explains that waitTimeout, when set, works alongside maxAttempts (which caps the number of polling attempts and has a service-provided default)
  • States that the waiter transitions to a failure state as soon as either limit is reached
  • Directs customers wanting to extend the wait to override maxAttempts or backoffStrategyV2

The new paragraph uses "transitions to a failure state" phrasing already established in the sibling maxAttempts(Integer) Javadoc in the same file.

No API or source-code changes.

Testing

  • mvn clean install -pl :sdk-core -P quick --am — sdk-core builds cleanly with the change
  • Javadoc syntax and {@link} references verified against the file's existing style and docs/guidelines/javadoc-guidelines.md

License

  • I confirm that this pull request can be released under the Apache 2 license

Add a paragraph to WaiterOverrideConfiguration.Builder#waitTimeout(Duration)
that explains the interaction between waitTimeout and maxAttempts.

Customers frequently expect waitTimeout alone to extend a waiter's total wait
time. Because services provide their own default maxAttempts (with no service
default for waitTimeout), setting waitTimeout longer than the service-default
budget (maxAttempts x delay-between-polls) causes the maxAttempts limit to
terminate the waiter first (see #5838).

The new paragraph:
- explains that waitTimeout, when set, works alongside maxAttempts (which
  caps the number of polling attempts and has a service-provided default)
- states that the waiter transitions to a failure state as soon as either
  limit is reached
- directs customers wanting to extend the wait to override maxAttempts to
  increase the number of polling attempts or backoffStrategyV2 to lengthen
  the delay between polls

The wording follows the "transitions to a failure state" phrasing already
used in the sibling maxAttempts(Integer) Javadoc in the same file.

No source-code / API changes.
@bhoradc
bhoradc requested a review from a team as a code owner August 18, 2026 23:39
@bhoradc bhoradc changed the title docs: clarify waitTimeout Javadoc in WaiterOverrideConfiguration.Builder docs: clarify waitTimeout Javadoc for WaiterOverrideConfiguration Aug 18, 2026
@bhoradc bhoradc added changelog-not-required Indicate changelog entry is not required for a specific PR no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required labels Aug 18, 2026
@bhoradc
bhoradc requested a review from joviegas August 18, 2026 23:44
* timeout doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The request
* can timeout early if it is determined that the next retry will breach the max wait time. It's disabled by default.
*
* <p>When set, {@code waitTimeout} works alongside {@link #maxAttempts(Integer)}, which caps the number of polling

@joviegas joviegas Aug 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits :

  1. Can we frame waitTimeout as an upper bound rather than a target, and if possible add the concrete Unexpected behavior from waiter if timeout provided #5838 case so it is clear the waiter errors out at the attempt limit, not after the full timeout?

  2. Can we add the note on maxAttempts too so both setters describe the interaction saying maxAttempts works with waitTimeout and waiters transitions to a failure state as soon as it reaches either limit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Sure, the upper-bound framing with an example helps, revised.

  2. Thought about it initially, and scoped to waitTimeout since it's null by default. The interaction only kicks in when a customer explicitly sets it, and the misinterpretation was directional. But only fair to make it symmetric, added it.

- waitTimeout: reframe as upper bound; add concrete #5838 example
  (maxAttempts=100 x 6s -> waiter terminates at ~10 min even with
  waitTimeout=30 min)
- maxAttempts: add reciprocal interaction note so both setters describe
  the two-limit stop-condition behavior

No source-code / API changes.
@bhoradc
bhoradc requested a review from joviegas August 19, 2026 18:59
@bhoradc
bhoradc added this pull request to the merge queue Aug 20, 2026
Merged via the queue into master with commit f41351a Aug 20, 2026
13 of 14 checks passed
@github-actions

Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

changelog-not-required Indicate changelog entry is not required for a specific PR no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants