feat(raft-library): task 5.3 — Groups D+E 7 test cases; fix Req 6.3 on_cancel_timeout in decided path

This commit is contained in:
Rongsong Shen 2026-05-31 06:58:02 +00:00
parent 0aa4c84bfe
commit 5c677bc52d
3 changed files with 279 additions and 3 deletions

View file

@ -225,6 +225,7 @@ int raft_on_vote_reply(raft_state_t *s, int from_idx, int granted, uint64_t term
void raft_on_election_timeout(raft_state_t *s)
{
if (s->election_decided) {
/* Req 6.3: cancel any pending timer and be a no-op */
s->cbs->on_cancel_timeout(s->ctx);
if (s->cbs->on_trace)
s->cbs->on_trace(s->ctx, "election_timeout_noop", NULL);