Question about timeout detection at steaming

120 views
Skip to first unread message

Carfield Yim

unread,
Mar 21, 2017, 10:58:01 PM3/21/17
to grpc.io
HI, I am a new user of grpc and using the steaming feature to let the server continue pushing update to client.

But there maybe case where somehow the server get some issue and the connection still there, so no exception, but just the update is not pushing. Can I detect this as timeout event? Or I have to start a thread at client side to check if the data keep pushing from server?

Thanks

Makarand Dharmapurikar

unread,
Mar 22, 2017, 1:20:31 AM3/22/17
to Carfield Yim, grpc.io
Which language is this in?

--
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/50294c65-b645-4490-86d4-0144aea62c7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carfield Yim

unread,
Mar 22, 2017, 2:02:01 AM3/22/17
to grpc.io, carf...@gmail.com
Thanks, it is Java server and C# client, maybe Java client 


On Wednesday, March 22, 2017 at 1:20:31 PM UTC+8, Makarand Dharmapurikar wrote:
Which language is this in?
On Tue, Mar 21, 2017 at 7:58 PM, Carfield Yim <carf...@gmail.com> wrote:
HI, I am a new user of grpc and using the steaming feature to let the server continue pushing update to client.

But there maybe case where somehow the server get some issue and the connection still there, so no exception, but just the update is not pushing. Can I detect this as timeout event? Or I have to start a thread at client side to check if the data keep pushing from server?

Thanks

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

Kun Zhang

unread,
Mar 22, 2017, 2:19:02 PM3/22/17
to grpc.io, carf...@gmail.com, Craig Tiller
The keep-alive feature can be helpful for detecting broken connection on the Java client.
However, the Netty keep-alive implementation is buggy as of 1.2.0 (https://github.com/grpc/grpc-java/issues/2828), and we are working on it.

Not sure if C# client has the same feature. I will leave it to the C core folks [+ctiller]

Carfield Yim

unread,
Mar 22, 2017, 9:29:31 PM3/22/17
to grpc.io, carf...@gmail.com, cti...@google.com
Can we use that? How if the Http is alive but there is no update, say the server is live but the data somehow no publishing, maybe just a bug at server that make the data stop published. Can we still use http status for that?

Kun Zhang

unread,
Mar 24, 2017, 2:13:43 PM3/24/17
to grpc.io, carf...@gmail.com, cti...@google.com
You shouldn't care about http status if you are using gRPC. gRPC has its own status space.
Like I said before, Java provides the keep-alive option, which allows the client to detect connectivity issue in a timely manner.

Of course you will need to find out first if it's due to a bug on the server.

Carfield Yim

unread,
Mar 25, 2017, 11:21:38 AM3/25/17
to Kun Zhang, grpc.io, cti...@google.com
oh, I see, so even if the server just don't get stuck, I should still get an exception at on error?

Kun Zhang

unread,
Mar 27, 2017, 11:45:59 AM3/27/17
to grpc.io, zhan...@google.com, cti...@google.com, carf...@carfield.com.hk
Ideally gRPC client library should detect the stuck connection and give you an error, which is what the keep-alive option tries to achieve.

Carfield Yim

unread,
Mar 27, 2017, 12:55:40 PM3/27/17
to Kun Zhang, grpc.io, Craig Tiller
Cool, thanks a lot, this is the sample code, right? https://github.com/grpc/grpc-java/issues/1648 And at the moment it is only for Java client, right?

You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/mrY1MMzBn9w/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Kun Zhang

unread,
Mar 27, 2017, 4:20:35 PM3/27/17
to grpc.io, zhan...@google.com, cti...@google.com, carf...@carfield.com.hk
Not sure what code you are referring to. Use OkHttpChannelBuilder.enableKeepAlive() or NettyChannelBuilder.enableKeepAlive() to turn it on in Java.
Craig (cc'ed) should be able to answer for wrapped languages.
To unsubscribe from this group and all its topics, send an email to grpc-io+u...@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
Reply all
Reply to author
Forward
0 new messages