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

rxl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new edf81af  Fix closed connection leak (#716)
edf81af is described below

commit edf81af225d1573848584a7e48f090a558a9c620
Author: billowqiu <billow...@163.com>
AuthorDate: Sat Jan 22 11:15:48 2022 +0800

    Fix closed connection leak (#716)
    
    Fix closed connection leak
---
 pulsar/internal/connection_pool.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pulsar/internal/connection_pool.go 
b/pulsar/internal/connection_pool.go
index cadeed1..4787ba1 100644
--- a/pulsar/internal/connection_pool.go
+++ b/pulsar/internal/connection_pool.go
@@ -81,6 +81,7 @@ func (p *connectionPool) GetConnection(logicalAddr *url.URL, 
physicalAddr *url.U
                // remove stale/failed connection
                if conn.closed() {
                        delete(p.connections, key)
+                       conn.Close()
                        p.log.Infof("Removed connection from pool key=%s 
logical_addr=%+v physical_addr=%+v",
                                key, conn.logicalAddr, conn.physicalAddr)
                        conn = nil // set to nil so we create a new one

Reply via email to