Skip to content
Snippets Groups Projects
Commit 63393f1d authored by pantianying's avatar pantianying
Browse files

fix deadlock

parent d93bfe12
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,10 @@ 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