diff --git a/v/raft.c b/v/raft.c index 4ea0b95df0..0caf4dfc20 100644 --- a/v/raft.c +++ b/v/raft.c @@ -1336,8 +1336,6 @@ _raft_foll_init(u2_raft* raf_u) // Start the initial election timeout. { - uv_timer_init(u2L, &raf_u->tim_u); - raf_u->tim_u.data = raf_u; uv_timer_start(&raf_u->tim_u, _raft_time_cb, _raft_election_rand(), 0); } } @@ -1359,6 +1357,10 @@ u2_raft_init() { u2_raft* raf_u = u2R; + // Initialize timer -- used in both single and multi-instance mode, for different things. + uv_timer_init(u2L, &raf_u->tim_u); + raf_u->tim_u.data = raf_u; + if ( 0 == u2_Host.ops_u.raf_c ) { _raft_lone_init(raf_u); }