Skip to content

Commit 578021b

Browse files
authored
fix(grpc): Handle timeouts with a DeadlineExceeded error (#3302)
When the proxy encounters gateway timeouts, it reports a gRPC Unavailable status code. This is at odds with the [grpc docs](https://grpc.io/docs/guides/deadlines/) which suggest that DeadlineExceeded should be used. This change updates the proxy's error handler to return DeadlineExceeded when a gRPC request encounters a timeout.
1 parent 684e8f4 commit 578021b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

linkerd/app/core/src/errors/respond.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl SyntheticHttpResponse {
120120
Self {
121121
close_connection: true,
122122
http_status: http::StatusCode::GATEWAY_TIMEOUT,
123-
grpc_status: tonic::Code::Unavailable,
123+
grpc_status: tonic::Code::DeadlineExceeded,
124124
message: Cow::Owned(msg.to_string()),
125125
location: None,
126126
}
@@ -130,7 +130,7 @@ impl SyntheticHttpResponse {
130130
Self {
131131
close_connection: false,
132132
http_status: http::StatusCode::GATEWAY_TIMEOUT,
133-
grpc_status: tonic::Code::Unavailable,
133+
grpc_status: tonic::Code::DeadlineExceeded,
134134
message: Cow::Owned(msg.to_string()),
135135
location: None,
136136
}

0 commit comments

Comments
 (0)