Skip to content

Commit 0e366bf

Browse files
committed
Retry IPFS request on Cloudflare 521 Web Server Down
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.
1 parent 415005f commit 0e366bf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graph/src/ipfs/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,14 @@ impl RequestError {
8787
return true;
8888
};
8989

90+
const CLOUDFLARE_WEB_SERVER_DOWN: u16 = 521;
91+
9092
[
9193
StatusCode::TOO_MANY_REQUESTS,
9294
StatusCode::INTERNAL_SERVER_ERROR,
9395
StatusCode::BAD_GATEWAY,
9496
StatusCode::SERVICE_UNAVAILABLE,
97+
StatusCode::from_u16(CLOUDFLARE_WEB_SERVER_DOWN).unwrap(),
9598
]
9699
.into_iter()
97100
.any(|x| status == x)

0 commit comments

Comments
 (0)