mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-26 19:50:51 +00:00
atomic backoff_end_time added
This commit is contained in:
parent
b19f76df01
commit
8715841291
@ -821,7 +821,7 @@ void CacheDictionary::update(BunchUpdateUnit & bunch_update_unit) const
|
|||||||
|
|
||||||
const auto now = std::chrono::system_clock::now();
|
const auto now = std::chrono::system_clock::now();
|
||||||
|
|
||||||
if (now > backoff_end_time)
|
if (now > backoff_end_time.load())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -902,7 +902,7 @@ void CacheDictionary::update(BunchUpdateUnit & bunch_update_unit) const
|
|||||||
backoff_end_time = now + std::chrono::seconds(calculateDurationWithBackoff(rnd_engine, error_count));
|
backoff_end_time = now + std::chrono::seconds(calculateDurationWithBackoff(rnd_engine, error_count));
|
||||||
|
|
||||||
tryLogException(last_exception, log, "Could not update cache dictionary '" + getFullName() +
|
tryLogException(last_exception, log, "Could not update cache dictionary '" + getFullName() +
|
||||||
"', next update is scheduled at " + ext::to_string(backoff_end_time));
|
"', next update is scheduled at " + ext::to_string(backoff_end_time.load()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ private:
|
|||||||
|
|
||||||
mutable std::exception_ptr last_exception;
|
mutable std::exception_ptr last_exception;
|
||||||
mutable std::atomic<size_t> error_count = 0;
|
mutable std::atomic<size_t> error_count = 0;
|
||||||
mutable std::chrono::system_clock::time_point backoff_end_time;
|
mutable std::atomic<std::chrono::system_clock::time_point> backoff_end_time;
|
||||||
|
|
||||||
mutable pcg64 rnd_engine;
|
mutable pcg64 rnd_engine;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user