Skip to content

Commit e4c19cc

Browse files
authored
Handle FailedPrecondition errors from the control plane (#948)
The control plane may return a FailedPrecondition error when the cluster is in an unexpected state -- when there are more than one pod for a single IP address. The proxy currently retries these lookups ad nauseum. This change updates the proxy's error handling to avoid retries when this error is returned, as if the IP were a non-cluster resource.
1 parent 7e27e5d commit e4c19cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

linkerd/app/core/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ pub fn discovery_rejected() -> tonic::Status {
7070

7171
pub fn is_discovery_rejected(err: &(dyn std::error::Error + 'static)) -> bool {
7272
if let Some(status) = err.downcast_ref::<tonic::Status>() {
73+
// Address is not resolveable
7374
status.code() == tonic::Code::InvalidArgument
75+
// Unexpected cluster state
76+
|| status.code() == tonic::Code::FailedPrecondition
7477
} else if let Some(err) = err.source() {
7578
is_discovery_rejected(err)
7679
} else {

0 commit comments

Comments
 (0)