Skip to content

Commit 77b52ac

Browse files
manishrjainmartinmr
authored andcommitted
Set deadline to 10s to allow quick recovery from partitions.
1 parent 4f23cb0 commit 77b52ac

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

conn/node.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ func (n *Node) streamMessages(to uint64, stream *Stream) {
376376
defer atomic.StoreInt32(&stream.alive, 0)
377377

378378
// Exit after this deadline. Let BatchAndSendMessages create another goroutine, if needed.
379-
deadline := time.Now().Add(60 * time.Second)
379+
// Let's set the deadline to 10s because if we increase it, then it takes longer to recover from
380+
// a partition and get a new leader.
381+
deadline := time.Now().Add(10 * time.Second)
380382
ticker := time.NewTicker(time.Second)
381383
defer ticker.Stop()
382384

0 commit comments

Comments
 (0)