mirror of
https://github.com/minio/minio.git
synced 2025-11-13 15:21:36 -05:00
rpc: Our rpcClient should make an attempt to reconnect. (#3221)
rpcClient should attempt a reconnect if the call fails with 'rpc.ErrShutdown' this is needed since at times when the servers are taken down and brought back up. The hijacked connection from net.Dial is usually closed. So upon first attempt rpcClient might falsely indicate that disk to be down, to avoid this state make another dial attempt to really fail. Fixes #3206 Fixes #3205
This commit is contained in:
@@ -166,11 +166,9 @@ func (authClient *AuthRPCClient) Call(serviceMethod string, args interface {
|
||||
// Call the underlying rpc.
|
||||
err = authClient.rpc.Call(serviceMethod, args, reply)
|
||||
|
||||
// Invalidate token to mark for re-login on subsequent reconnect.
|
||||
if err != nil {
|
||||
if err.Error() == rpc.ErrShutdown.Error() {
|
||||
authClient.isLoggedIn = false
|
||||
}
|
||||
// Invalidate token, and mark it for re-login on subsequent reconnect.
|
||||
if err != nil && err == rpc.ErrShutdown {
|
||||
authClient.isLoggedIn = false
|
||||
}
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user