Skip to content

Commit

Permalink
fix bug when proxy reading redis get error
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzhe1991 committed Sep 17, 2015
1 parent 1eaeb08 commit b7639ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/proxy/router/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ func (bc *BackendConn) newBackendReader() (*redis.Conn, chan<- *Request, error)
for r := range tasks {
resp, err := c.Reader.Decode()
bc.setResponse(r, resp, err)
if err != nil {
// close tcp to tell writer we are failed and should quit
c.Close()
}
}
}()
return c, tasks, nil
Expand Down

0 comments on commit b7639ef

Please sign in to comment.