google/tarpc

RPC deadline and clock skew on different machines

ditsing opened this issue · 2 comments

I have a development machine machine and a Raspberry pi that happens to have its system clock out of sync. All my RPCs from Pi to my machine would fail with DeadlineExceeded, because Pi sets the deadline at 2021.

Does it make sense to use relative time (10 seconds) instead of absolute system time to represent RPC deadline? Given typical clock skew between machines could be O(seconds), using absolute time seems quite inaccurate.

tikue commented

Hey, thanks for the great question! That definitely sounds like an annoying problem! I think you're right that a relative deadline should be sent over the wire — it can then be converted back to an absolute deadline on the other end, so that deadline propagation between multiple RPC hops works correctly.

tikue commented

@ditsing I'd love your feedback on #367 before I merge it!