Skip to content

Commit

Permalink
Fix: closeErr == nil
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexStocks committed Sep 1, 2019
1 parent ff4f9b9 commit aa5c160
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protocol/dubbo/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (p *gettyRPCClientPool) getGettyRpcClient(protocol, addr string) (*gettyRPC
p.conns = p.conns[:len(p.conns)-1]

if d := now - conn.getActive(); d > p.ttl {
if closeErr := conn.safeClose(); closeErr != nil {
if closeErr := conn.safeClose(); closeErr == nil {
p.remove(conn)
}
continue
Expand Down Expand Up @@ -331,7 +331,7 @@ func (p *gettyRPCClientPool) release(conn *gettyRPCClient, err error) {
}

if len(p.conns) >= p.size {
if closeErr := conn.safeClose(); closeErr != nil {
if closeErr := conn.safeClose(); closeErr == nil {
// delete @conn from client pool
p.remove(conn)
}
Expand Down

0 comments on commit aa5c160

Please sign in to comment.