How can I close all connections in a java ManagedChannel and restart them?

25 views
Skip to first unread message

yfe...@gmail.com

unread,
Sep 17, 2019, 4:22:30 PM9/17/19
to grpc.io
Hey folks,

My understanding is that a ManagedChannel can have a number of possible connections backing it. Is there a way to kill all the connections and restart them without shutting down the ManagedChannel and creating a new one?

This has come about due to issues related to https://github.com/grpc/grpc-java/pull/5599 where I know that the application is in a bad state and would rather restart all connections than wait the 15 min for them to timeout.

Thanks!

Jihun Cho

unread,
Sep 18, 2019, 2:28:08 PM9/18/19
to grpc.io
can you use keepalive to make grpc aware of the bad connections? 

yfe...@gmail.com

unread,
Sep 18, 2019, 2:39:50 PM9/18/19
to grpc.io
Hi Jihun!

Sadly not easily. I'm in a bit of dependency hell trying to update to > 1.21 and would then have ensure that native EPoll is used over NIO.
Hoping clearing all underlying connections might be the easy way out.

Yosef

Eric Anderson

unread,
Sep 19, 2019, 12:08:54 PM9/19/19
to yfe...@gmail.com, grpc.io
It seems you are thinking of the OS-based TCP_USER_TIMEOUT. But there is also keepalive that you can configure, which is what A8-client-side-keepalive.md is talking about. It has been available for quite a while.

--
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/cf774c56-845f-4fc7-af86-e329c1003324%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages