Skip to content

Commit

Permalink
Retry IPFS request on Cloudflare 521 Web Server Down (#5687)
Browse files Browse the repository at this point in the history
In the integration tests, some subgraphs will sync on fraction3, leading
to an error as they failed to sync on integer.

On some runs, fraction3 will also error leading to a successful test;
this happens when the subgraph fails to sync due to an HTTP 521 error
received when querying the testnet IPFS node. This is a
non-deterministic error, and the request can simply be retried.
  • Loading branch information
encalypto authored Oct 25, 2024
1 parent 22bca4e commit b9e1c5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions graph/src/ipfs/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,14 @@ impl RequestError {
return true;
};

const CLOUDFLARE_WEB_SERVER_DOWN: u16 = 521;

[
StatusCode::TOO_MANY_REQUESTS,
StatusCode::INTERNAL_SERVER_ERROR,
StatusCode::BAD_GATEWAY,
StatusCode::SERVICE_UNAVAILABLE,
StatusCode::from_u16(CLOUDFLARE_WEB_SERVER_DOWN).unwrap(),
]
.into_iter()
.any(|x| status == x)
Expand Down

0 comments on commit b9e1c5f

Please sign in to comment.