Skip to content

[CRE-3889] Retry org resolution#2097

Open
agparadiso wants to merge 3 commits into
mainfrom
CRE-3889_retry_org_resolution
Open

[CRE-3889] Retry org resolution#2097
agparadiso wants to merge 3 commits into
mainfrom
CRE-3889_retry_org_resolution

Conversation

@agparadiso
Copy link
Copy Markdown
Contributor

@agparadiso agparadiso commented May 28, 2026

Description

This pr was already adding a single retry + cache.

What we are adding here is an increase in the scope of errors in which we retry (before it was only on unavailable) + adding exponential backoff with a max of 3 retries

Requires

Supports

Copilot AI review requested due to automatic review settings May 28, 2026 15:13
@agparadiso agparadiso requested a review from a team as a code owner May 28, 2026 15:13
@github-actions
Copy link
Copy Markdown

👋 agparadiso, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 28, 2026

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-common

View full report

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the OrgResolverFallback wrapper to retry org resolution for a broader set of transient gRPC errors, using bounded exponential backoff, before falling back to the in-memory cache.

Changes:

  • Replace the single “Unavailable retry” with a bounded retry loop and exponential backoff.
  • Expand retried gRPC status codes beyond Unavailable via a new isRetriableGRPCCode helper.
  • Update and extend unit tests to reflect the new retry behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pkg/services/orgresolver/fallback.go Adds bounded retries with exponential backoff, expands retriable error set, and adjusts fallback behavior.
pkg/services/orgresolver/fallback_test.go Updates retry call-count assertions and adds a test case for retrying DeadlineExceeded.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/services/orgresolver/fallback.go
Comment thread pkg/services/orgresolver/fallback.go Outdated
Comment thread pkg/services/orgresolver/fallback.go
@agparadiso agparadiso force-pushed the CRE-3889_retry_org_resolution branch from e7cbdb3 to eaf3738 Compare May 28, 2026 15:31
backoff = initialRetryBackoff
)

for attempt := 1; attempt <= maxGetAttempts; attempt++ {
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.

Could you use "github.com/smartcontractkit/chainlink-common/pkg/utils/retry" here?

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