diff --git a/CHANGELOG.md b/CHANGELOG.md index 51551325d..b638eed29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release. - ConnectionPool does not close UnknownRole connections (#208) - Segmentation faults in ConnectionPool requests after disconnect (#208) - Addresses in ConnectionPool may be changed from an external code (#208) +- ConnectionPool recreates connections too often (#208) ## [1.8.0] - 2022-08-17 diff --git a/connection_pool/connection_pool.go b/connection_pool/connection_pool.go index 68fcf7155..83959141a 100644 --- a/connection_pool/connection_pool.go +++ b/connection_pool/connection_pool.go @@ -702,20 +702,7 @@ func (connPool *ConnectionPool) checker() { return } if e.Conn.ClosedNow() { - addr := e.Conn.Addr() - if conn, _ := connPool.getConnectionFromPool(addr); conn == nil { - continue - } - conn, _ := tarantool.Connect(addr, connPool.connOpts) - if conn != nil { - err := connPool.setConnectionToPool(addr, conn) - if err != nil { - conn.Close() - log.Printf("tarantool: storing connection to %s failed: %s\n", addr, err.Error()) - } - } else { - connPool.deleteConnectionFromPool(addr) - } + connPool.deleteConnectionFromPool(e.Conn.Addr()) } case <-timer.C: for _, addr := range connPool.addrs {