If a TCP connection to memcache is not being returned to the free list (because an error has occurred on the connection and its reuse is not allowed), explicitly close the connection.
@@ -183,6 +183,8 @@ func (cn *conn) extendDeadline() {
func (cn *conn) condRelease(err *error) {
if *err == nil || resumableError(*err) {
cn.release()
+ } else {
+ cn.nc.Close()
}