From a9105b5a8dbf47bd52221c2516f2ee87d4472dec Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Mon, 27 Nov 2017 14:06:42 -0800 Subject: [PATCH] clientv3: document context timeout error with server-side clock skew Signed-off-by: Gyu-Ho Lee --- clientv3/doc.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clientv3/doc.go b/clientv3/doc.go index dacc5bb34..ffa7495bf 100644 --- a/clientv3/doc.go +++ b/clientv3/doc.go @@ -54,6 +54,12 @@ // // ctx is canceled by another routine // } else if err == context.DeadlineExceeded { // // ctx is attached with a deadline and it exceeded +// } else if ev, ok := status.FromError(err); ok { +// code := ev.Code() +// if code == codes.DeadlineExceeded { +// // server-side context might have timed-out first (due to clock skew) +// // while original client-side context is not timed-out yet +// } // } else if verr, ok := err.(*v3rpc.ErrEmptyKey); ok { // // process (verr.Errors) // } else {