Skip to content

Commit ad47f5f

Browse files
committed
Trip on 502
1 parent 50f22d3 commit ad47f5f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

gha-cache/src/api.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,8 +826,6 @@ impl AtomicCircuitBreaker for AtomicBool {
826826
}
827827

828828
fn check_err(&self, e: &Error, callback: &CircuitBreakerTrippedCallback) {
829-
dbg!(e);
830-
831829
match e {
832830
Error::ApiError {
833831
status: reqwest::StatusCode::TOO_MANY_REQUESTS,
@@ -836,11 +834,17 @@ impl AtomicCircuitBreaker for AtomicBool {
836834
| Error::TwirpError(ClientError::TwirpError(TwirpErrorResponse {
837835
code: TwirpErrorCode::ResourceExhausted,
838836
..
839-
})) => {
837+
}))
838+
| Error::TwirpError(ClientError::HttpError {
839+
// The cache backend seems to give out this error for overload:
840+
// Twirp error: http error, status code: 502 Bad Gateway, msg:unknown error
841+
status: StatusCode::BAD_GATEWAY,
842+
..
843+
}) => {
840844
// meat is below
841845
}
842846
otherwise => {
843-
tracing::debug!(%otherwise, "Checked error for resource exhaustion, but it appears to be a different cause");
847+
tracing::error!(%otherwise, "Checked error for resource exhaustion, but it appears to be a different cause");
844848
return;
845849
}
846850
}

0 commit comments

Comments
 (0)