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

GH-150: adjust feign retryer configuration #151

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

nicdard
Copy link
Collaborator

@nicdard nicdard commented Feb 23, 2023

Description

Configure Retries in Feign utility:

  • retry calls maximum 3 times (5 before)
  • enlarge the maximum waiting period to 4s (1s before)
  • use a larger base interval of 1s (100ms before)

Related Issue

#150

Motivation and Context

This would better tune calls retries. We do not want in general to retry too much, and we want more time between each of the calls to wait for the called system to recover. Note that even in case of a retry after header present in the response, the maximum waiting period will be used in place of the time specified in the response to place the next call when lower:

 if (e.retryAfter() != null) {
        interval = e.retryAfter().getTime() - currentTimeMillis();
        if (interval > maxPeriod) {
          interval = maxPeriod;
        }

which is ok to protect the service for hanging up for too long. 4s seems like a reasonable time to wait before retrying and eventually fail, also, the maximal waiting period that can be calculated with the given parameters by the exponential backoff strategy fits the maximum as well.

Another solution would be the approach proposed here: #149

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@francoisledroff francoisledroff changed the base branch from main to GH-150 February 1, 2024 09:27
@francoisledroff francoisledroff merged commit e3a2bb2 into adobe:GH-150 Feb 1, 2024
@francoisledroff
Copy link
Collaborator

merged this to GH-150: next step #215

nicdard added a commit that referenced this pull request Feb 12, 2024
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