From ccdf270424097c89eb80e48d66d7865dc93920d8 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Tue, 28 Mar 2017 11:12:50 -0700 Subject: [PATCH] add document to ClientHandshake about returning temporary error (#1125) --- credentials/credentials.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/credentials/credentials.go b/credentials/credentials.go index 4d45c3e3..a8114d67 100644 --- a/credentials/credentials.go +++ b/credentials/credentials.go @@ -102,6 +102,10 @@ type TransportCredentials interface { // authentication protocol on rawConn for clients. It returns the authenticated // connection and the corresponding auth information about the connection. // Implementations must use the provided context to implement timely cancellation. + // gRPC will try to reconnect if the error returned is a temporary error + // (io.EOF, context.DeadlineExceeded or err.Temporary() == true). + // If the returned error is a wrapper error, implementations should make sure that + // the error implements Temporary() to have the correct retry behaviors. ClientHandshake(context.Context, string, net.Conn) (net.Conn, AuthInfo, error) // ServerHandshake does the authentication handshake for servers. It returns // the authenticated connection and the corresponding auth information about