diff --git a/linkerd/app/inbound/src/policy/api.rs b/linkerd/app/inbound/src/policy/api.rs index 51cc47c8db..a15a68a19c 100644 --- a/linkerd/app/inbound/src/policy/api.rs +++ b/linkerd/app/inbound/src/policy/api.rs @@ -114,17 +114,23 @@ impl Recover for GrpcRecover { type Backoff = ExponentialBackoffStream; fn recover(&self, status: tonic::Status) -> Result { - if status.code() == tonic::Code::InvalidArgument - || status.code() == tonic::Code::FailedPrecondition - { - return Err(status); + match status.code() { + tonic::Code::InvalidArgument | tonic::Code::FailedPrecondition => Err(status), + tonic::Code::Ok => { + tracing::debug!( + grpc.message = status.message(), + "Completed; retrying with a backoff", + ); + Ok(self.0.stream()) + } + code => { + tracing::warn!( + grpc.status = %code, + grpc.message = status.message(), + "Unexpected policy controller response; retrying with a backoff", + ); + Ok(self.0.stream()) + } } - - tracing::warn!( - grpc.status = %status.code(), - grpc.message = status.message(), - "Unexpected policy controller response; retrying with a backoff", - ); - Ok(self.0.stream()) } } diff --git a/linkerd/app/outbound/src/policy/api.rs b/linkerd/app/outbound/src/policy/api.rs index e5d1f60e0c..bcbad3c30e 100644 --- a/linkerd/app/outbound/src/policy/api.rs +++ b/linkerd/app/outbound/src/policy/api.rs @@ -124,6 +124,13 @@ impl Recover for GrpcRecover { tonic::Code::InvalidArgument | tonic::Code::FailedPrecondition => Err(status), // Indicates no policy for this target tonic::Code::NotFound | tonic::Code::Unimplemented => Err(status), + tonic::Code::Ok => { + tracing::debug!( + grpc.message = status.message(), + "Completed; retrying with a backoff", + ); + Ok(self.0.stream()) + } code => { tracing::warn!( grpc.status = %code, diff --git a/linkerd/app/src/dst.rs b/linkerd/app/src/dst.rs index 7cf8155d2a..c1f62af014 100644 --- a/linkerd/app/src/dst.rs +++ b/linkerd/app/src/dst.rs @@ -97,19 +97,23 @@ impl Recover for BackoffUnlessInvalidArgument { type Backoff = ExponentialBackoffStream; fn recover(&self, status: tonic::Status) -> Result { - // Address is not resolvable - if status.code() == tonic::Code::InvalidArgument - // Unexpected cluster state - || status.code() == tonic::Code::FailedPrecondition - { - return Err(status); + match status.code() { + tonic::Code::InvalidArgument | tonic::Code::FailedPrecondition => Err(status), + tonic::Code::Ok => { + tracing::debug!( + grpc.message = status.message(), + "Completed; retrying with a backoff", + ); + Ok(self.0.stream()) + } + code => { + tracing::warn!( + grpc.status = %code, + grpc.message = status.message(), + "Unexpected policy controller response; retrying with a backoff", + ); + Ok(self.0.stream()) + } } - - tracing::warn!( - grpc.status = %status.code(), - grpc.message = status.message(), - "Unexpected destination controller response; retrying with a backoff", - ); - Ok(self.0.stream()) } }