···121121 src = s.source();
122122 }
123123124124- e.status()
125125- .map_or(false, |s| is_status_their_fault(s.as_u16()))
124124+ e.status().map_or(false, |s| {
125125+ // lets not consider internal server errors for throttling
126126+ // a server might be having a hard time on one request, but not on the rest
127127+ s.as_u16() != 500 && is_status_their_fault(s.as_u16())
128128+ })
126129}
127130128131/// shared describeRepo signal-checking logic used by both relay and retry producers.
···8787 )
8888}
89899090+// use this for public (unauth) xrpc errors
9091pub fn is_status_their_fault(status: u16) -> bool {
9191- return matches!(
9292- status,
9393- 502 // BAD_GATEWAY
9494- | 503 // SERVICE_UNAVAILABLE
9595- | 504 // GATEWAY_TIMEOUT
9696- | 522 // CONNECTION_TIMEOUT
9797- | 525 // SSL_HANDSHAKE_FAILURE
9898- | 530 // SITE_FROZEN
9999- | 404 // NOT FOUND: we know its not our fault because we use known xrpcs..
100100- );
9292+ return (status >= 100 && status < 200) // informational, why are we here?
9393+ || (status >= 500 && status < 600) // server error :>
9494+ || (status >= 300 && status < 400) // any 3xx error doesnt make sense in the context of a pds / relay
9595+ || matches!(
9696+ status,
9797+ 404 // NOT FOUND: we know its not our fault because we use known xrpcs..
9898+ | 436 // some stupid ass error code idk, some domain park uses this i think???
9999+ | 403 // FORBIDDEN: sob
100100+ | 401 // UNAUTHORIZED: sob
101101+ );
101102}
102103103104/// outcome of [`RetryWithBackoff::retry`] when the operation does not succeed.