Skip to content
Snippets Groups Projects
Commit 3a1c7b78 authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy
Browse files

raft: do not rely on just ev_is_active for timers

When timer has 0 timeout and 0 repeat, during timers preparation
libev makes them inactive right away but puts into the array of
pending events.

Therefore to check if a timer is really active (will be executed
in the future) need to look both at ev_is_active() and
ev_is_pending().

It could happen only during split-vote, because all the other
places use election_timeout + random shift, while split vote uses
just random shift - it can be 0.

The patch makes raft do that for all timer checks. Also to make
the testing reliable and not depend on random the shift factor now
is configurable. For the test it is set to 0.

Closes #6847

NO_DOC=Bugfix
NO_CHANGELOG=Bug was not released
parent dd1a510e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment