Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct gRPC 'max-concurrency exhausted' error messages #847

Merged
merged 1 commit into from Jan 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions linkerd/app/core/src/errors.rs
Expand Up @@ -265,12 +265,15 @@ fn set_grpc_status(
headers.insert(GRPC_STATUS, code_header(code));
headers.insert(GRPC_MESSAGE, HeaderValue::from_static("request timed out"));
code
} else if error.is::<FailFastError>() {
} else if let Some(e) = error.downcast_ref::<FailFastError>() {
let code = Code::Unavailable;
headers.insert(GRPC_STATUS, code_header(code));
headers.insert(
GRPC_MESSAGE,
HeaderValue::from_static("proxy max-concurrency exhausted"),
HeaderValue::from_str(&e.to_string()).unwrap_or_else(|error| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the failfast scopes are static strings, i wonder if we could just add more of the message to them, so that they can be used with HeaderValue::from_static...string overhead probably doesn't matter that much so this is probably unnecessary...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, probably more we could yakshave around this; but later.

warn!(%error, "Failed to encode fail-fast error message");
HeaderValue::from_static("Service in fail-fast")
}),
);
code
} else if error.is::<tower::timeout::error::Elapsed>() {
Expand Down