Skip to content

Commit

Permalink
Set deadline to 10s to allow quick recovery from partitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
manishrjain authored and martinmr committed May 1, 2019
1 parent 4f23cb0 commit 77b52ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion conn/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ func (n *Node) streamMessages(to uint64, stream *Stream) {
defer atomic.StoreInt32(&stream.alive, 0)

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

Expand Down

0 comments on commit 77b52ac

Please sign in to comment.