dinowernli / concord

A distributed key-value store in Rust
Apache License 2.0
4 stars 0 forks source link

Fix a bug where cancelled follower timeouts were still happening #26

Closed dinowernli closed 3 years ago

dinowernli commented 3 years ago

The bug occurred because we had two layers of task::spawn() calls in the follower timeout logic. This in turn led to cancellation only affecting the outer layer, and not actually cancelling the control flow.

The overall effect was a lot of thrash in leader election because even with an established leader, runaway follower timeout code would start new elections.

This change also does a few minor cleanups: