From 470d0f1e5836a59842a48c55f0916ac03ad931ed Mon Sep 17 00:00:00 2001 From: Robert B Gordon Date: Fri, 13 Jun 2014 11:25:01 -0500 Subject: [PATCH] Seems like we should actually check the reference count. --- consul/pool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consul/pool.go b/consul/pool.go index 91f53a6772..804a900f5a 100644 --- a/consul/pool.go +++ b/consul/pool.go @@ -288,7 +288,7 @@ func (p *ConnPool) clearConn(conn *Conn) { p.Unlock() // Close down immediately if idle - if refCount := atomic.LoadInt32(&conn.shouldClose); refCount == 0 { + if refCount := atomic.LoadInt32(&conn.refCount); refCount == 0 { conn.Close() } }