grpc-java: support graceful server shutdown

475 views
Skip to first unread message

michael...@fanduel.com

unread,
Dec 22, 2016, 10:21:30 AM12/22/16
to grpc.io
Hello,

When we redeploy our servers on AWS, behind an ELB we would like to support graceful shutdown by pushing a GOAWAY frame to the already connected clients and initiate a graceful shutdown of the clients connection to the server. After some amount of time after the GOAWAY frame has prompted shutdown we would like the clients to re-establish a connection with the servers. 

I see this sort of behaviour implemented in the GO server https://github.com/grpc/grpc-go/pull/774

Is this also implemented in the grpc-java server (a link to the code would be appreciated) ?

Also, we plan to implement a scheduled DNS name resolver for updating our ELB DNS with the appropriate TTL https://github.com/grpc/grpc-java/issues/2514 , will the GOAWAY frame behaviour above effect a scheduled DNS name resolver?

Thanks,

Mike

Makarand Dharmapurikar

unread,
Dec 22, 2016, 3:57:32 PM12/22/16
to michael...@fanduel.com, grpc.io
Both Java and C based clients will respect GOAWAY frames, in that a GOAWAY will induce the client to use a different connection for the following requests. Will defer to others for DNS resolver interaction.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/58f821f2-6b8a-4a8b-b20b-a2d744179627%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

michael...@fanduel.com

unread,
Dec 22, 2016, 6:37:12 PM12/22/16
to grpc.io, michael...@fanduel.com
Thank you Makarand.

Does this imply that a grpc-java server emits a GOAWAY frame on shutdown, i.e. on jvm closure?


On Thursday, December 22, 2016 at 8:57:32 PM UTC, Makarand Dharmapurikar wrote:
Both Java and C based clients will respect GOAWAY frames, in that a GOAWAY will induce the client to use a different connection for the following requests. Will defer to others for DNS resolver interaction.
On Thu, Dec 22, 2016 at 7:21 AM, <michael...@fanduel.com> wrote:
Hello,

When we redeploy our servers on AWS, behind an ELB we would like to support graceful shutdown by pushing a GOAWAY frame to the already connected clients and initiate a graceful shutdown of the clients connection to the server. After some amount of time after the GOAWAY frame has prompted shutdown we would like the clients to re-establish a connection with the servers. 

I see this sort of behaviour implemented in the GO server https://github.com/grpc/grpc-go/pull/774

Is this also implemented in the grpc-java server (a link to the code would be appreciated) ?

Also, we plan to implement a scheduled DNS name resolver for updating our ELB DNS with the appropriate TTL https://github.com/grpc/grpc-java/issues/2514 , will the GOAWAY frame behaviour above effect a scheduled DNS name resolver?

Thanks,

Mike

--
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.

Carl Mastrangelo

unread,
Jan 3, 2017, 1:11:10 PM1/3/17
to grpc.io
Google treats JVM shutdown as a more immediate action to take, while GOAWAY is not as urgent.  At least in our cases, the JVM shutting down (i.e. code run from Runtime.addShutdownHook) implies that everything should be destroyed asap.  

I think what you want is to shutdown the gRPC server and all connections before initiating a full jvm shutdown.  That would have the desired behavior you want, and wouldn't conflate the two shutdowns.
Reply all
Reply to author
Forward
0 new messages