correct way to shut down a synchronous server

18 views
Skip to first unread message

Jeff

unread,
Aug 2, 2019, 7:27:31 PM8/2/19
to grpc.io
Hi all,

Is there an example of the correct way to shut down a synchronous server? or do synchronous servers not need to be explicitly shutdown? Thanks!

Yang Gao

unread,
Aug 7, 2019, 1:42:27 PM8/7/19
to grpc.io
You can call a grpc::Server::Shutdown with a timeout, after the timeout the pending rpcs will be cancelled. In your rpc handler (if you have long-lived streaming or rpcs), you will need to check ServerContext::isCancelled to finish up the rpcs. The sync server will not finish cleanup before you finish all the rpcs.
Reply all
Reply to author
Forward
0 new messages