C++ Graceful server shutdown

291 views
Skip to first unread message

shikhach...@gmail.com

unread,
Nov 28, 2017, 5:17:26 AM11/28/17
to grpc.io
Hello , 

gRPC version : 1.0.0

9 pthreads are created during server startup (equivalent to the cores available). I am following  the follwing sequence to shutdown the server : 
- server_->shutdown()
- cq_0>shutdown()

The above sequence stops listening at the mentioned IP:Port combination but somehow isn't cleaning those existing pthreads even when streaming / GET request is in progress.
Please suggest if i am missing some shutdown step & also could you redirect me the relevant piece of code responsible for server shutdown. I checked server.cc, dynamic_thread_pool.cc all logic appears fine.

-Thanks
Shikha

shikhach...@gmail.com

unread,
Nov 28, 2017, 5:19:28 AM11/28/17
to grpc.io
Typo : Even when no connection is in progress

Yang Gao

unread,
Dec 7, 2017, 4:42:29 PM12/7/17
to grpc.io
Do you mean you created 9 threads or grpc created 9 threads?
I assume you are working on an async grpc server? Are those threads your rpc handling threads?
grpc creates some threads internally to do some work offload.
Reply all
Reply to author
Forward
0 new messages