From a5df7374e82bb7c258cf49043eb5de889eb38f1e Mon Sep 17 00:00:00 2001
From: AlexStocks <alexstocks@foxmail.com>
Date: Mon, 2 Sep 2019 00:04:59 +0800
Subject: [PATCH] Fix: closeErr == nil

---
 protocol/dubbo/pool.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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