Dealing with client/server time diff (skew)

64 views
Skip to first unread message

jim.c....@gmail.com

unread,
Jul 12, 2020, 11:58:10 AM7/12/20
to grpc.io
Our client computers are not sync'd with the server - I have seen them differ by as much as 5 minutes! If I set a deadline of now+20secs and the client is actually 1 minute behind the server will the server simply ignore the request since it detects the time has already passed and assumes the client will not be waiting any more?

If the answer is 'yes, server will ignore request' I have two supplemental questions:

1) Is there any way to set the deadline to be a duration (e.g. in secs) rather than a UTC time?

2) Can I set a retry count? For example, I have timed 'TransientFailure' consecutive delays at 0,3,3,9,18 secs so if I could set retries=5 would I get a DEADLINE_EXCEEDED error at approx 33 seconds?

I am using gRPC with C# (Visual Studio 2019) and have been unable to find any C# code samples for either 1) or 2)


Jan Tattermusch

unread,
Jul 17, 2020, 4:57:33 AM7/17/20
to grpc.io
Clock skew between server and client is not a problem and grpc will handle that correctly.

The way it works is even though the deadlines are absolute while on server / client, when transmitted on the wire they are converted to relative timeouts - so the clock skew won't affect correctness of the behavior.
For details, see "grpc-timeout" header in the wire format spec https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
Reply all
Reply to author
Forward
0 new messages