Skip to content

shutdown server while client is still connected #57

@flixr

Description

@flixr

Is there a way to cleanly shutdown the server while there are still clients connected (i.e. finish the connections)?
I could not find any method/callback for this.. Am I missing something or is this not implemented?

When I try to shutdown the server and a RpcHandler is still running (because the client didn't disconnect yet), it will just hang forever.
If I then shutdown the client I get a failure with RPCs still in flight:

I1130 16:54:18.130954     7 server.cc:215] Shutting down server.

-> hangs here until I shutdown the client and then fails:

I1130 16:56:32.376948     7 completion_queue_thread.cc:39] Shutting down completion queue 0x557085fd3a40
I1130 16:56:32.377357     7 completion_queue_thread.cc:39] Shutting down completion queue 0x557085fc8f20
I1130 16:56:32.377645     7 event_queue_thread.cc:38] Shutting down event queue 0x557085fcc400
I1130 16:56:32.377735     7 event_queue_thread.cc:38] Shutting down event queue 0x557085fcbb00
I1130 16:56:32.377812     7 server.cc:237] Shutdown complete.
F1130 16:56:32.383496     7 rpc.cc:355] RPCs still in flight!

It would be nice to have a OnShutdown callback in the RpcHandler (where the handler could then finish the write and hence shutdown the connection to the client).
Or should this be done e.g. by registering a custom callback via ExecutionContext?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions