Skip to content
Snippets Groups Projects
Unverified Commit a8cb98e8 authored by Xin.Zh's avatar Xin.Zh Committed by GitHub
Browse files

Merge pull request #183 from pantianying/fix_deadlock

Fix: gettyRPCClientPool.remove deadlock
parents b38db964 ad15595c
No related branches found
No related tags found
No related merge requests found
......@@ -275,6 +275,7 @@ func (p *gettyRPCClientPool) close() {
func (p *gettyRPCClientPool) getGettyRpcClient(protocol, addr string) (*gettyRPCClient, error) {
p.Lock()
defer p.Unlock()
if p.conns == nil {
return nil, errClientPoolClosed
}
......@@ -290,12 +291,9 @@ func (p *gettyRPCClientPool) getGettyRpcClient(protocol, addr string) (*gettyRPC
continue
}
conn.created = now //update created time
p.Unlock()
return conn, nil
}
// create new conn
p.Unlock()
return newGettyRPCClientConn(p, protocol, addr)
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment