Skip to content

Commit

Permalink
Whenever the connection is closed always call cluster.HandleError
Browse files Browse the repository at this point in the history
  • Loading branch information
Zariel committed Mar 29, 2014
1 parent 6a13b30 commit 32a6094
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ func (c *Conn) execSimple(op operation) (interface{}, error) {
f.setLength(len(f) - headerSize)
if _, err := c.conn.Write([]byte(f)); err != nil {
c.conn.Close()
c.cluster.HandleError(c, err, true)
return nil, err
}
if f, err = c.recv(); err != nil {
Expand Down Expand Up @@ -284,6 +285,7 @@ func (c *Conn) exec(op operation, trace Tracer) (interface{}, error) {

if n, err := c.conn.Write(req); err != nil {
c.conn.Close()
c.cluster.HandleError(c, err, true)
c.uniq <- id
if n > 0 {
return nil, ErrProtocol
Expand Down

0 comments on commit 32a6094

Please sign in to comment.