瀏覽代碼

rafthttp: log stream stopped message before closing channel

Was causing spurious goroutine leak failures in testing.
Anthony Romano 9 年之前
父節點
當前提交
0250f0c984
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      rafthttp/stream.go

+ 1 - 1
rafthttp/stream.go

@@ -320,8 +320,8 @@ func (cr *streamReader) run() {
 		// overhead when retry.
 		case <-time.After(100 * time.Millisecond):
 		case <-cr.stopc:
-			close(cr.done)
 			plog.Infof("stopped streaming with peer %s (%s reader)", cr.peerID, t)
+			close(cr.done)
 			return
 		}
 	}