Skip to content

Commit

Permalink
Update Raft to set heartbeat fast-path handler
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed Jan 6, 2015
1 parent 37876b9 commit 1f0e109
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ func NewRaft(conf *Config, fsm FSM, logs LogStore, stable StableStore, snaps Sna
return nil, err
}

// Setup a heartbeat fast-path to avoid head-of-line
// blocking where possible. It MUST be safe for this
// to be called concurrently with a blocking RPC.
trans.SetHeartbeatHandler(r.processRPC)

// Start the background work
r.goFunc(r.run)
r.goFunc(r.runFSM)
Expand Down

0 comments on commit 1f0e109

Please sign in to comment.