rafthttp: only close streamMsgApp when updating term

In all stream types, streamMsgApp needs to be closed when
updating term because its stream connection can only be used under
a certain term. But there is no need to close other streams, which
may waste time and reduce performance.
This commit is contained in:
Yicheng Qin 2015-05-04 07:38:21 -07:00
parent 9699a501f3
commit 8637a4bf69

View File

@ -324,7 +324,9 @@ func (cr *streamReader) updateMsgAppTerm(term uint64) {
return
}
cr.msgAppTerm = term
cr.close()
if cr.t == streamTypeMsgApp {
cr.close()
}
}
// TODO: always cancel in-flight dial and decode