瀏覽代碼

clientv3: document context timeout error with server-side clock skew

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Gyu-Ho Lee 8 年之前
父節點
當前提交
a9105b5a8d
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      clientv3/doc.go

+ 6 - 0
clientv3/doc.go

@@ -54,6 +54,12 @@
 //			// ctx is canceled by another routine
 //			// ctx is canceled by another routine
 //		} else if err == context.DeadlineExceeded {
 //		} else if err == context.DeadlineExceeded {
 //			// ctx is attached with a deadline and it exceeded
 //			// 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 {
 //		} else if verr, ok := err.(*v3rpc.ErrEmptyKey); ok {
 //			// process (verr.Errors)
 //			// process (verr.Errors)
 //		} else {
 //		} else {