When developing my first hashicorp/raft implementation I was stuck at a stone wall it seemed. Somehow I could bootstrap one of the nodes and this would win the election and the raft observation for it becoming Leader also made it in, but then nothing. I couldn't figure out why all RPCs timed out after that.
I started to run locally and debugged using VS Code Launch configuration (which uses Delve) and found that before bootstrapping there was a "runCandidate" goroutine, but after bootstrapping there was no "runLeader" goroutine.
Turns out the leader loop never started! How could this be? Then my mind wandered to the observer that I added:
ch := make(chan raft.Observation, 1)
r.RegisterObserver(raft.NewObserver(ch, true, func(o *raft.Observation) bool {
// *RequestVoteRequest