mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 05:26:58 +00:00
service/raft: raft_group0: fix sleep_with_exponential_backoff
It was immediately jumping to _max_retry_period.
This commit is contained in:
@@ -1029,7 +1029,7 @@ struct sleep_with_exponential_backoff {
|
||||
static constexpr std::chrono::seconds _max_retry_period{16};
|
||||
future<> operator()(abort_source& as) {
|
||||
co_await sleep_abortable(_retry_period, as);
|
||||
_retry_period = std::max(_retry_period * 2, _max_retry_period);
|
||||
_retry_period = std::min(_retry_period * 2, _max_retry_period);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user