From 84d7825a77df218c382fe741f5fb71a5b6fefbba Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Wed, 28 Oct 2015 11:13:53 -0700 Subject: [PATCH] rafthttp: stop masking errMemberRemoved in pipeline It makes logic more straightforward and readable. Also, it makes the handle method consistent with stream and snapshot sender. --- rafthttp/pipeline.go | 1 - rafthttp/transport_test.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/rafthttp/pipeline.go b/rafthttp/pipeline.go index 075777cca..9eab7a6e5 100644 --- a/rafthttp/pipeline.go +++ b/rafthttp/pipeline.go @@ -159,7 +159,6 @@ func (p *pipeline) post(data []byte) (err error) { // always be stopped. So we use reportCriticalError to report it to errorc. if err == errMemberRemoved { reportCriticalError(err, p.errorc) - return nil } return err } diff --git a/rafthttp/transport_test.go b/rafthttp/transport_test.go index 43a46a925..64a64ee00 100644 --- a/rafthttp/transport_test.go +++ b/rafthttp/transport_test.go @@ -128,6 +128,7 @@ func TestTransportUpdate(t *testing.T) { func TestTransportErrorc(t *testing.T) { errorc := make(chan error, 1) tr := &Transport{ + Raft: &fakeRaft{}, LeaderStats: stats.NewLeaderStats(""), ErrorC: errorc, streamRt: newRespRoundTripper(http.StatusForbidden, nil),