Skip to content

[Merged by Bors] - Add automatic retries in Poet's HTTP client #4018

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

Closed
wants to merge 2 commits into from

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Jan 27, 2023

Motivation

HTTP requests are fallible but communication node -> poet is critical. Node should retry talking with poet in case of:

  • ephemeral errors (5xx, 429 - too many requests)
  • 404 - not found. A Poet returns 404 if a node queries for proof too early (the proof is not yet ready - hence "not found").

Changes

  • use https://github.com/hashicorp/go-retryablehttp for automatic retries with a custom policy to retry on 404,
  • use linear backoff with small jitter (within 1 second) to prevent spamming poet with retries at the same time from all nodes.

Closes #2614

@poszu
Copy link
Contributor Author

poszu commented Jan 30, 2023

bors merge

bors bot pushed a commit that referenced this pull request Jan 30, 2023
## Motivation
HTTP requests are fallible but communication node -> poet is critical. Node should retry talking with poet in case of:
- ephemeral errors (5xx, 429 - too many requests)
- 404 - not found. A Poet returns 404 if a node queries for proof too early (the proof is not yet ready - hence "not found").

## Changes
- use https://github.com/hashicorp/go-retryablehttp for automatic retries with a custom policy to retry on 404,
- use linear backoff with small jitter (within 1 second) to prevent spamming poet with retries at the same time from all nodes.

Closes #2614
@bors
Copy link

bors bot commented Jan 30, 2023

Pull request successfully merged into develop.

Build succeeded:

@bors bors bot changed the title Add automatic retries in Poet's HTTP client [Merged by Bors] - Add automatic retries in Poet's HTTP client Jan 30, 2023
@bors bors bot closed this Jan 30, 2023
@bors bors bot deleted the add-automatic-retries-in-poet-http-client branch January 30, 2023 15:29
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.

Flaky TestNIPostBuilderWithClients
2 participants