benbjohnson/go-raft — pull request #36 by xiangli-cmu (2013-07-02 05:56:02+00:00)
Title: when promoted, election timeout should be stopped

As I clean up the promote function, I was thinking we may explicitly separate follower, candidate and leader state.
There are still some issues in the current implementation. I think for each state, we constrain the code in one go routine(like commitCenter and collectVote may change to Leader() and Candidate). When state changes, we can create a new go routine for that state and return current go routine.