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

Retry GetResource NotFound when creating #1809

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Nov 7, 2024

Introduces a retry for NotFound errors from GetResource executed right after Create.

Based on the logs from our CI runs we suspect eventual consistency in AWS may cause some resources to fail with NotFound in Get even after WaitForResourceOpCompletion succeeded.

Relates: #1186

Copy link
Contributor

github-actions bot commented Nov 7, 2024

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@t0yv0 t0yv0 changed the title Retry failing get resource Retry GetResource NotFound when creating Nov 7, 2024
@t0yv0 t0yv0 requested a review from mjeffryes November 7, 2024 17:59
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 90.32258% with 3 lines in your changes missing coverage. Please review.

Project coverage is 45.67%. Comparing base (91e1b65) to head (b594242).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
provider/pkg/client/client.go 90.32% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1809      +/-   ##
==========================================
+ Coverage   45.44%   45.67%   +0.22%     
==========================================
  Files          38       38              
  Lines        5886     5916      +30     
==========================================
+ Hits         2675     2702      +27     
- Misses       2988     2991       +3     
  Partials      223      223              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@t0yv0 t0yv0 enabled auto-merge (squash) November 7, 2024 18:11
@t0yv0 t0yv0 merged commit b590804 into master Nov 7, 2024
18 checks passed
@t0yv0 t0yv0 deleted the t0yv0/retry-failing-get-resource branch November 7, 2024 18:12
Copy link
Contributor

@flostadler flostadler left a comment

Choose a reason for hiding this comment

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

LGTM

ctx context.Context,
typeName, identifier string,
) (map[string]interface{}, error) {
retryBackoff := retry.NewExponentialJitterBackoff(30 * time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd reduce the max duration here a bit. We'd now wait up to ~60 seconds. That seems a bit too long to me.

Eventual consistency delays for those services are usually in the millis.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll send a quick follow-up PR, this one merged already.

t0yv0 added a commit that referenced this pull request Nov 8, 2024
GetResource NotFound backoff introduced in
#1809 allowed long time
wait periods up to 30 seconds. This change makes the max wait period 3
seconds at this is more appropriate for AWS eventual consistency
propagation delays this backoff tries to compensate for.
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.

3 participants