Skip to content

fix: add maxDelay to prevent exponential backoff in waiters#839

Merged
s3cube merged 1 commit into
aws-actions:masterfrom
EzgiTastan:fix/add-maxdelay-to-prevent-exponential-backoff
Mar 1, 2026
Merged

fix: add maxDelay to prevent exponential backoff in waiters#839
s3cube merged 1 commit into
aws-actions:masterfrom
EzgiTastan:fix/add-maxdelay-to-prevent-exponential-backoff

Conversation

@EzgiTastan

Copy link
Copy Markdown
Contributor

Issue #, if available:
N/A (new issue discovered)

Description of changes:

Problem

The SDK v3 upgrade (commits a15de3c, b5c6c3f) added minDelay but did not add maxDelay to the waiter options. Without maxDelay, the AWS SDK defaults to 120 seconds, causing exponential backoff between polls:

Poll # Delay
1 15s
2 ~30s
3 ~60s
4+ 120s

This means even if the ECS service becomes stable quickly, the action may wait up to 2 minutes before the next poll detects it.

Solution

Added maxDelay: WAIT_DEFAULT_DELAY_SEC (15 seconds) to all three waiters:

  • waitUntilTasksStopped
  • waitUntilServicesStable
  • waitUntilDeploymentSuccessful

This ensures consistent 15-second polling intervals without exponential backoff.

Testing

  • All 45 existing tests pass
  • Rebuilt dist/index.js with npm run package

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment thread dist/index.js Outdated
const waitTaskResponse = await waitUntilTasksStopped({
client: ecs,
minDelay: WAIT_DEFAULT_DELAY_SEC,
maxDelay: WAIT_DEFAULT_DELAY_SEC,

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.

Can we keep the default as is, and allow it to be overridden?

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.

Sure, I'll add an optional wait-max-delay-seconds input parameter.

@EzgiTastan EzgiTastan force-pushed the fix/add-maxdelay-to-prevent-exponential-backoff branch from 8682a43 to 6fe2cd9 Compare February 18, 2026 07:29
@EzgiTastan EzgiTastan requested a review from s3cube February 25, 2026 12:31
@s3cube

s3cube commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

@EzgiTastan , the PR looks good to me. Are you able to update the Package distribution file, we can go ahead and merge it soon after.

@EzgiTastan

Copy link
Copy Markdown
Contributor Author

Hi @s3cube , I've verified locally that the dist/ is up to date. It looks like the failing CI is due to a transient npm registry 403 error, could you please re-run the failed job?

@s3cube s3cube left a comment

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.

LGTM

@s3cube s3cube merged commit 5fda33a into aws-actions:master Mar 1, 2026
6 of 7 checks passed
@s3cube

s3cube commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @EzgiTastan! 🎉

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants