Skip to content

Commit

Permalink
Log a warning when the controller clients receive an error (#2499)
Browse files Browse the repository at this point in the history
The controller client includes a recovery/backoff module that causes
resolutions to be retried when an unexpected error is encountered.
These events are only logged at debugging and trace log levels.

This change updates the destination and policy controller recovery
modules to log unexpected errors as warnings.
  • Loading branch information
olix0r authored and hawkw committed Nov 6, 2023
1 parent dd47e38 commit d478c2e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 5 additions & 1 deletion linkerd/app/inbound/src/policy/api.rs
Expand Up @@ -109,7 +109,11 @@ impl Recover<tonic::Status> for GrpcRecover {
return Err(status);
}

tracing::trace!(%status, "Recovering");
tracing::warn!(
grpc.status = %status.code(),
grpc.message = status.message(),
"Unexpected policy controller response; retrying with a backoff",
);
Ok(self.0.stream())
}
}
8 changes: 6 additions & 2 deletions linkerd/app/outbound/src/policy/api.rs
Expand Up @@ -113,8 +113,12 @@ impl Recover<tonic::Status> for GrpcRecover {
tonic::Code::InvalidArgument | tonic::Code::FailedPrecondition => Err(status),
// Indicates no policy for this target
tonic::Code::NotFound | tonic::Code::Unimplemented => Err(status),
_ => {
tracing::debug!(%status, "Recovering");
code => {
tracing::warn!(
grpc.status = %code,
grpc.message = status.message(),
"Unexpected policy controller response; retrying with a backoff",
);
Ok(self.0.stream())
}
}
Expand Down
6 changes: 5 additions & 1 deletion linkerd/app/src/dst.rs
Expand Up @@ -94,7 +94,11 @@ impl Recover<tonic::Status> for BackoffUnlessInvalidArgument {
return Err(status);
}

tracing::trace!(%status, "Recovering");
tracing::warn!(
grpc.status = %status.code(),
grpc.message = status.message(),
"Unexpected destination controller response; retrying with a backoff",
);
Ok(self.0.stream())
}
}

0 comments on commit d478c2e

Please sign in to comment.