From fde91d588a0a9feda3498775cb83396fbc259327 Mon Sep 17 00:00:00 2001 From: siddontang Date: Sat, 14 Feb 2015 09:25:21 +0800 Subject: [PATCH] fix can not close slave if master is down --- server/replication.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/replication.go b/server/replication.go index a03baa0..15e3657 100644 --- a/server/replication.go +++ b/server/replication.go @@ -155,6 +155,10 @@ func (m *master) runReplication(restart bool) { for { m.state.Set(replConnectState) + if m.needQuit() { + return + } + if _, err := m.conn.Do("ping"); err != nil { log.Errorf("ping master %s error %s, try 3s later", m.addr, err.Error()) time.Sleep(3 * time.Second)