diff --git a/protocol/dubbo/pool.go b/protocol/dubbo/pool.go index 546a5b335a..ecd57e466a 100644 --- a/protocol/dubbo/pool.go +++ b/protocol/dubbo/pool.go @@ -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) }