From b7639ef5419ee15f94b08880498766cbc9d00af3 Mon Sep 17 00:00:00 2001 From: Phil Yang Date: Thu, 17 Sep 2015 20:16:11 +0800 Subject: [PATCH] fix bug when proxy reading redis get error --- pkg/proxy/router/backend.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/proxy/router/backend.go b/pkg/proxy/router/backend.go index d63268f5c..f2db00d9b 100644 --- a/pkg/proxy/router/backend.go +++ b/pkg/proxy/router/backend.go @@ -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