You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2020/02/09 08:09:01 UTC

[dubbo-go] branch develop updated: Fix: https://github.com/AlexStocks/getty/issues/27

This is an automated email from the ASF dual-hosted git repository.

alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
     new 33f82cd  Fix: https://github.com/AlexStocks/getty/issues/27
33f82cd is described below

commit 33f82cd154a3ee5ef861c6465333c4945c9d4b1a
Author: AlexStocks <al...@foxmail.com>
AuthorDate: Sun Feb 9 16:06:58 2020 +0800

    Fix: https://github.com/AlexStocks/getty/issues/27
    
    Signed-off-by: AlexStocks <al...@foxmail.com>
---
 protocol/dubbo/pool.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/protocol/dubbo/pool.go b/protocol/dubbo/pool.go
index 2df1c69..9d38158 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)