Pārlūkot izejas kodu

rafthttp: log stream stopped message before closing channel

Was causing spurious goroutine leak failures in testing.
Anthony Romano 9 gadi atpakaļ
vecāks
revīzija
0250f0c984
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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
 		}
 	}