Ensure unusable connections get closed
Fixes a bug where a connection that was marked as unusable didn't prevent it from getting checked backed into the pool.pull/2825/head
parent
0c6ea32540
commit
8cbda9694e
|
@ -43,7 +43,9 @@ func (w *ShardWriter) WriteShard(shardID, ownerID uint64, points []tsdb.Point) e
|
|||
if !ok {
|
||||
panic("wrong connection type")
|
||||
}
|
||||
defer conn.Close() // return to pool
|
||||
defer func(conn net.Conn) {
|
||||
conn.Close() // return to pool
|
||||
}(conn)
|
||||
|
||||
// Build write request.
|
||||
var request WriteShardRequest
|
||||
|
|
Loading…
Reference in New Issue