Skip to content

Commit

Permalink
[Chttp2Server] Set HTTP2 error to NO_ERROR to do graceful GOAWAYs
Browse files Browse the repository at this point in the history
  • Loading branch information
yashykt committed Jan 23, 2025
1 parent ba9b36f commit 4dbef2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/ext/transport/chttp2/server/chttp2_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,10 @@ void NewChttp2ServerListener::ActiveConnection::SendGoAwayImplLocked() {
// Send a GOAWAY if the transport exists
if (transport != nullptr) {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
op->goaway_error =
GRPC_ERROR_CREATE("Server is stopping to serve requests.");
// Set an HTTP2 error of NO_ERROR to do graceful GOAWAYs.
op->goaway_error = grpc_error_set_int(
GRPC_ERROR_CREATE("Server is stopping to serve requests."),
StatusIntProperty::kHttp2Error, GRPC_HTTP2_NO_ERROR);
transport->PerformOp(op);
}
});
Expand Down

0 comments on commit 4dbef2c

Please sign in to comment.