mirror of
https://github.com/minio/minio.git
synced 2025-11-13 15:21:36 -05:00
rpcclient: fix leaky connection (#3471)
Previously, more than one goroutine calls RPCClient.dial(), each goroutine gets a new rpc.Client but only one such client is stored into RPCClient object. This leads to leaky connection at the server side. This is fixed by taking lock at top of dial() and release on return.
This commit is contained in:
@@ -111,7 +111,7 @@ func newAuthClient(cfg *authConfig) *AuthRPCClient {
|
||||
// Save the config.
|
||||
config: cfg,
|
||||
// Initialize a new reconnectable rpc client.
|
||||
rpc: newClient(cfg.address, cfg.path, cfg.secureConn),
|
||||
rpc: newRPCClient(cfg.address, cfg.path, cfg.secureConn),
|
||||
// Allocated auth client not logged in yet.
|
||||
isLoggedIn: false,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user