close client pool

pull/2661/head
Cory LaNou 2015-05-27 10:06:04 -06:00
parent 1228de4e7c
commit 4da0e9a93c
2 changed files with 2 additions and 2 deletions

View File

@ -49,11 +49,10 @@ func (c *clientPool) conn(n *meta.NodeInfo) (net.Conn, error) {
return conn, err
}
func (c *clientPool) close() error {
func (c *clientPool) close() {
c.mu.Lock()
for _, p := range c.pool {
p.Close()
}
c.mu.Unlock()
return nil
}

View File

@ -139,6 +139,7 @@ func (w *Writer) Close() error {
if w.pool == nil {
return fmt.Errorf("client already closed")
}
w.pool.close()
w.pool = nil
return nil
}