Skip to content

Commit 96f3fcb

Browse files
manishrawat1992Manish Rawat
andauthored
retry on cloudflare timeout (#2695)
**Summary** Some of the self hosted installations are hosted behind cloudflare. By default, cloudflare proxy_write_timeout is set at 30s. If this timeout is breached, Cloudflare responds with error with status code 524. Currently this is treated as non retriable error by sentry-cli. https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-524/ This PR ensures that sentry-cli retries on this timeout. Co-authored-by: Manish Rawat <manish@Manishs-MacBook-Air.local>
1 parent 1d7245d commit 96f3fcb

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/api/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const RETRY_STATUS_CODES: &[u32] = &[
7070
http::HTTP_STATUS_503_SERVICE_UNAVAILABLE,
7171
http::HTTP_STATUS_504_GATEWAY_TIMEOUT,
7272
http::HTTP_STATUS_507_INSUFFICIENT_STORAGE,
73+
http::HTTP_STATUS_524_CLOUDFLARE_TIMEOUT,
7374
];
7475

7576
/// Helper for the API access.

src/utils/http.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub const HTTP_STATUS_502_BAD_GATEWAY: u32 = 502;
1010
pub const HTTP_STATUS_503_SERVICE_UNAVAILABLE: u32 = 503;
1111
pub const HTTP_STATUS_504_GATEWAY_TIMEOUT: u32 = 504;
1212
pub const HTTP_STATUS_507_INSUFFICIENT_STORAGE: u32 = 507;
13+
pub const HTTP_STATUS_524_CLOUDFLARE_TIMEOUT: u32 = 524;
1314

1415
lazy_static! {
1516
static ref LINK_TOKEN_RE: Regex = Regex::new(

0 commit comments

Comments
 (0)