grpc-dart icon indicating copy to clipboard operation
grpc-dart copied to clipboard

Add KeepAlive support

Open a14n opened this issue 7 years ago • 6 comments

I have a gRPC service (in dart) that provides a rpc method returning a stream of messages.

In some cases, this stream may stay without message during a long time. Without activity on the connection during 2 minutes a Firewall kills the connection and the client has to reconnect.

So it would be great to provide a way to send hearbeat.

This problem seems to be addressed by https://github.com/grpc/grpc/blob/master/doc/keepalive.md

a14n avatar Mar 14 '19 14:03 a14n

Any workaround meanwhile ?

I get repeated gRPC Error (4, Deadline exceeded) and didn't find a way to keep the connection alive (or trying to reset the connection when encountering this error).

aloisdeniel avatar Apr 27 '19 17:04 aloisdeniel

I think we have the same issue aswell. We are currently looking for a workaround but have yet been unsuccessful in finding any implementations.

I've tried setting it up on the server side (in go) by increasing the keepalive timing, default was set to 30s.

s := grpc.NewServer(grpc.KeepaliveParams(keepalive.ServerParameters{
		MaxConnectionIdle: 5 * time.Minute,
	}))

But this has not been working for us. Are there any updates on this at this time?

Jessev6 avatar Aug 29 '19 10:08 Jessev6

This is very important for the Firebase Firestore Dart SDK since the stream may stay without message during a long time.

long1eu avatar Nov 30 '19 10:11 long1eu

We have no plans to implement this functionality due to limited bandwidth that our team has. PRs implementing this are welcome though.

mraleph avatar Oct 05 '20 10:10 mraleph

Still no plans to implement?

hwkim1127 avatar Jun 26 '22 18:06 hwkim1127

The project is in the same state as stated in https://github.com/grpc/grpc-dart/issues/157#issuecomment-703536505

mraleph avatar Jun 27 '22 07:06 mraleph

Any updates on this?

psypdt avatar Nov 30 '22 09:11 psypdt

@psypdt see https://github.com/grpc/grpc-dart/issues/157#issuecomment-703536505

mraleph avatar Nov 30 '22 13:11 mraleph

our project depends on it . :((((((((((((((( is there other way to solve this problem?

ShahroozAnsari avatar Dec 14 '22 15:12 ShahroozAnsari

is there other way to solve this problem?

I think the only way to solve it is to implement it and send a PR.

mraleph avatar Dec 15 '22 09:12 mraleph

our project depends on it . :((((((((((((((( is there other way to solve this problem?

You can create an easy work around. Add small (empty/ping) message, and create in your code the timer to send it once in awhile.

It is unefficient and small extra work but it works.

guyluz11 avatar Dec 15 '22 09:12 guyluz11

our project depends on it . :((((((((((((((( is there other way to solve this problem?

You can create an easy work around. Add small (empty/ping) message, and create in your code the timer to send it once in awhile.

It is unefficient and small extra work but it works.

I do this but its not best and good way for solve it I'm waiting for official update for it.

ShahroozAnsari avatar Mar 10 '23 14:03 ShahroozAnsari

Maybe when it will reach 100 upvotes gRPC team will decide to take this one 😆

guyluz11 avatar Mar 10 '23 15:03 guyluz11

@guyluz11 probably waiting for the 10 years anniversary )

zs-dima avatar Mar 10 '23 16:03 zs-dima

This is waiting for somebody to send a PR or for us to get some resources for active development.

mraleph avatar Mar 11 '23 11:03 mraleph

this issue is most liked issue at grpc-dart topic. :( we basely use Grpc and flutter in ours projects.

ShahroozAnsari avatar Apr 02 '23 11:04 ShahroozAnsari