Skip to content

Conversation

@bbengfort
Copy link
Contributor

@bbengfort bbengfort commented Dec 19, 2025

Scope of changes

Increases the backoff retry delay on Quarterdeck JWKS syncs from Endeavor in an effort to repair rate limiting errors.

Fixes SC-35715

Type of change

  • new feature
  • bug fix
  • documentation
  • testing
  • technical debt
  • other (describe)

Acceptance criteria

This PR will be merged without review.

Definition of Done

  • I have manually tested the change running it locally (having rebuilt all containers) or via unit tests
  • I have added unit and/or integration tests that cover my changes
  • I have added new test fixtures as needed to support added tests
  • I have updated the dependencies list if necessary (including updating yarn.lock and/or go.sum)

Copilot AI review requested due to automatic review settings December 19, 2025 14:07
Copy link
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 adds explicit exponential backoff configuration to the Quarterdeck JWKS synchronization to address rate limiting errors (SC-35715). Previously, the backoff used library defaults; now specific parameters are configured including initial interval, multiplier, randomization factor, and maximum interval.

Key Changes:

  • Added four new backoff configuration constants (InitialInterval, RandomizationFactor, Multiplier, MaxInterval)
  • Modified the Sync() method to explicitly configure exponential backoff with these constants
  • Added a clarifying comment about the critical section in GetKey()

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

Comment on lines +266 to +270
delay := backoff.NewExponentialBackOff()
delay.InitialInterval = BackoffInitialInterval
delay.RandomizationFactor = BackoffRandomizationFactor
delay.Multiplier = BackoffMultiplier
delay.MaxInterval = BackoffMaxInterval
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The PR description states this change "increases the backoff retry delay" to address rate limiting, but the MaxInterval of 30 seconds may actually be shorter than typical exponential backoff defaults (which are often 60+ seconds or unlimited). With the current settings, retries will occur at: 1s, 2s, 4s, 8s, 16s, 30s, 30s, etc., reaching the maximum delay after only 5 retries. For rate limiting issues, consider either increasing MaxInterval (e.g., to 60 seconds or more) or increasing InitialInterval to provide more breathing room between retries, ensuring the backoff truly increases as intended.

Copilot uses AI. Check for mistakes.
return nil, auth.ErrInvalidKeyID
}

// Critical Section: only called from Verify which has a read lock
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The comment states "only called from Verify" but GetKey is also called from the Refresh method (line 162), which also holds a read lock. Consider updating the comment to be more accurate, for example: "Critical Section: called from Verify and Refresh, both holding a read lock".

Suggested change
// Critical Section: only called from Verify which has a read lock
// Critical Section: called from Verify and Refresh, both holding a read lock

Copilot uses AI. Check for mistakes.
@bbengfort bbengfort merged commit 9338c31 into main Dec 19, 2025
11 checks passed
@bbengfort bbengfort deleted the sc-35715 branch December 19, 2025 14:24
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