Browse Source

rafthttp: log stream stopped message before closing channel

Was causing spurious goroutine leak failures in testing.
Anthony Romano 9 years ago
parent
commit
0250f0c984
1 changed files with 1 additions and 1 deletions
  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
 		}
 	}