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

DCMAW-10829: Enhances http request retry strategy with exponential backoff and full jitter #344

Merged
merged 19 commits into from
Jan 20, 2025

Conversation

jmooney-dd
Copy link
Contributor

@jmooney-dd jmooney-dd commented Jan 17, 2025

DCMAW-10829

What changed

  • sendHttpRequest:
    • Updates retry policy with exponential backoff and full jitter
    • Updates interface to use Result pattern after discussion feedback here
  • Updates functions that consume sendHttpRequest as interface has changed:

Why did it change

Exponential backoff

Reduces load on target server giving it time to recover while gradually increasing the interval between retries

Full jitter

Prevents synchronised retries which can overwhelm the target server by altering the delay between retries by a random amount

Sonar security hotspot

Status

Resolved - Akin has resolved the hotspot: https://gds.slack.com/archives/C060PANF03T/p1737366725133829

Summary

Sonar flagged that we are using a pseudorandom number generator and asks we check it's safe to use here. We are using it to calculate a jitter value.

Link to hotspot

​Evidence

Deployed stack and ran api tests - all passing

Checklists

  • There is a ticket raised for this PR that is present in the branch name
  • No PII data logged. See guidance here
  • Demo to a BA, TA, and the team.
  • Update README with any new instructions or tasks

@jmooney-dd jmooney-dd changed the title Dcmaw 10829 retry delay DCMAW-10829: Enhances http request retry strategy Jan 17, 2025
@jmooney-dd jmooney-dd force-pushed the DCMAW-10829-retry-delay branch from 7a11773 to cb1e74c Compare January 17, 2025 18:18
@jmooney-dd jmooney-dd marked this pull request as ready for review January 20, 2025 09:46
@jmooney-dd jmooney-dd requested review from a team as code owners January 20, 2025 09:46
@jmooney-dd jmooney-dd changed the title DCMAW-10829: Enhances http request retry strategy DCMAW-10829: Enhances http request retry strategy exponential backoff and jitter Jan 20, 2025
@jmooney-dd jmooney-dd changed the title DCMAW-10829: Enhances http request retry strategy exponential backoff and jitter DCMAW-10829: Enhances http request retry strategy with exponential backoff and jitter Jan 20, 2025
@jmooney-dd jmooney-dd changed the title DCMAW-10829: Enhances http request retry strategy with exponential backoff and jitter DCMAW-10829: Enhances http request retry strategy with exponential backoff and full jitter Jan 20, 2025
@jmooney-dd jmooney-dd merged commit 316c176 into main Jan 20, 2025
2 checks passed
@jmooney-dd jmooney-dd deleted the DCMAW-10829-retry-delay branch January 20, 2025 14:22
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