diff options
author | Sree Kuchibhotla <sreek@google.com> | 2018-03-30 15:41:14 -0700 |
---|---|---|
committer | Sree Kuchibhotla <sreek@google.com> | 2018-03-30 15:41:14 -0700 |
commit | 1fd44337fc117429955a84b53f2efdee89a15c60 (patch) | |
tree | 3b75b63090a8b661ae40e06d1dadee653eab6bf7 /src | |
parent | 22054d4a22efd14ac4b103bb3c71576c07f2db19 (diff) |
Shutdown documentation
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lib/surface/server.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index f7505c888e..cb34def740 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -1161,6 +1161,22 @@ static void listener_destroy_done(void* s, grpc_error* error) { gpr_mu_unlock(&server->mu_global); } +/* + - Kills all pending requests-for-incoming-RPC-calls (i.e the requests made via + grpc_server_request_call and grpc_server_request_registered call will now be + cancelled). See 'kill_pending_work_locked()' + + - Shuts down the listeners (i.e the server will no longer listen on the port + for new incoming channels). + + - Iterates through all channels on the server and sends shutdown msg (see + 'channel_broadcaster_shutdown()' for details) to the clients via the + transport layer. The transport layer then guarantees the following: + -- Sends shutdown to the client (for eg: HTTP2 transport sends GOAWAY) + -- If the server has outstanding calls that are in the process, the + connection is NOT closed until the server is done with all those calls + -- Once, there are no more calls in progress, the channel is closed + */ void grpc_server_shutdown_and_notify(grpc_server* server, grpc_completion_queue* cq, void* tag) { listener* l; |