Repository navigation
fix(aws/opensearch): retry the STS account lookup after a transient failure - #617
Conversation
…ailure resolveAccountID memoised the first GetCallerIdentity error behind a sync.Once, so one throttle or timeout disabled post-purchase tagging for the client's lifetime. Cache only a successful lookup under a mutex. refs #53 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refs #53 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Retryable lookup and successful caching providers/aws/services/opensearch/client.go, providers/aws/services/opensearch/client_test.go, CHANGELOG.md |
The client serializes account-ID lookups with a mutex. Lookup errors are not cached, while a successful account ID is cached. The test verifies retry after a throttling error and reuse of the successful result. The changelog records the behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested labels: priority/p2, severity/medium, triaged, urgency/this-quarter, impact/few, effort/s, type/bug
Merge Risk: 
Minimal · up to 99779
-
No issue identified in the account-lookup retry change prevents merging after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
refs #53
What
resolveAccountIDin the OpenSearch client memoised the firstGetCallerIdentityerror behind async.Once, so one throttle or timeout disabled post-purchase tagging for the client's lifetime. It now caches only a successful lookup (mutex) and retries after a failure.The audit also listed Redshift; origin/main no longer has that cache there.
Proof
TestResolveAccountID_RetriesAfterTransientFailurefails on origin/main (error sticks) and passes with the fix.go test -race -count=1 ./...in providers/aws with GOWORK=off and with the workspace; golangci-lint v2.10.1 clean.🤖 Generated with Claude Code
Summary by CodeRabbit