Skip to content

Commit

Permalink
HTTP2: Improve "GOAWAY received" status message (grpc#31619)
Browse files Browse the repository at this point in the history
* Improve GOAWAY received status message

* Remove unused if
  • Loading branch information
yashykt authored Nov 15, 2022
1 parent 510b214 commit afec648
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/core/ext/transport/chttp2/transport/chttp2_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -985,14 +985,17 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
uint32_t goaway_error,
uint32_t last_stream_id,
absl::string_view goaway_text) {
// Discard the error from a previous goaway frame (if any)
if (!t->goaway_error.ok()) {
}
t->goaway_error = grpc_error_set_str(
grpc_error_set_int(
grpc_error_set_int(GRPC_ERROR_CREATE("GOAWAY received"),
grpc_core::StatusIntProperty::kHttp2Error,
static_cast<intptr_t>(goaway_error)),
grpc_error_set_int(
grpc_core::StatusCreate(
absl::StatusCode::kUnavailable,
absl::StrFormat(
"GOAWAY received; Error code: %u; Debug Text: %s",
goaway_error, goaway_text),
DEBUG_LOCATION, {}),
grpc_core::StatusIntProperty::kHttp2Error,
static_cast<intptr_t>(goaway_error)),
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE),
grpc_core::StatusStrProperty::kRawBytes, goaway_text);

Expand Down

0 comments on commit afec648

Please sign in to comment.