diff --git a/protocol/dubbo/pool.go b/protocol/dubbo/pool.go index 2df1c6935305e0d70635613f509021e5b9203833..9d381585b56ec439f8ebb8938109baf47bb502b2 100644 --- a/protocol/dubbo/pool.go +++ b/protocol/dubbo/pool.go @@ -360,6 +360,13 @@ func (p *gettyRPCClientPool) put(conn *gettyRPCClient) { return } + // check whether @conn has existed in p.conns or not. + for i := range p.conns { + if p.conns[i] == conn { + return + } + } + if len(p.conns) >= p.size { // delete @conn from client pool // p.remove(conn)