mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Fix race in wait
This commit is contained in:
parent
7575115069
commit
279d9c78ee
@ -160,7 +160,7 @@ void RefreshTask::cancel()
|
||||
void RefreshTask::wait()
|
||||
{
|
||||
std::unique_lock lock(mutex);
|
||||
refresh_cv.wait(lock, [&] { return info.state != RefreshState::Running; });
|
||||
refresh_cv.wait(lock, [&] { return info.state != RefreshState::Running && !refresh_immediately; });
|
||||
if (info.last_refresh_result == LastRefreshResult::Error)
|
||||
throw Exception(ErrorCodes::REFRESH_FAILED, "Refresh failed: {}", info.exception_message);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user