grpc server shutdown

35 views
Skip to first unread message

Jeff

unread,
Aug 20, 2019, 6:18:52 PM8/20/19
to grpc.io
If shutdown is called on a server more than once, is the behavior defined? Is it safe to do this or is there a chance of a crash?

Yang Gao

unread,
Aug 21, 2019, 1:13:41 PM8/21/19
to grpc.io
It is safe to call Shutdown more than once.

Juanli Shen

unread,
Aug 21, 2019, 1:15:00 PM8/21/19
to grpc.io
It's definitely not the expected usage. And from the API comment, I believe there is no guarantee that this will work in the future even if it worked now.

Why would you want to shut down a sever multiple times?


On Tuesday, August 20, 2019 at 3:18:52 PM UTC-7, Jeff wrote:

Jeff Steger

unread,
Aug 21, 2019, 3:37:52 PM8/21/19
to Juanli Shen, grpc.io
That’s like saying, ‘why would u want to call delete on a null pointer’ (in C++). Well, because in some cases it is convenient to do so (rather than pathologically checking for null every single time you delete something). Deleting a null pointer is harmless, and shutting down a server that is already shutdown should imo also be harmless. But there is no documentation I have read that makes it clear either way, and there really should be. Does anyone have a definitive answer to this?

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/52288c69-b39e-4dde-ae62-85c0014c4638%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages