mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Fix data race on global BlockStreamProfileInfo in PullingAsyncPipelineExecutor.
This commit is contained in:
parent
1feebe9d73
commit
1c8600bb0a
@ -220,9 +220,15 @@ Block PullingAsyncPipelineExecutor::getExtremesBlock()
|
||||
|
||||
BlockStreamProfileInfo & PullingAsyncPipelineExecutor::getProfileInfo()
|
||||
{
|
||||
if (lazy_format)
|
||||
return lazy_format->getProfileInfo();
|
||||
|
||||
static BlockStreamProfileInfo profile_info;
|
||||
return lazy_format ? lazy_format->getProfileInfo()
|
||||
: profile_info;
|
||||
static std::once_flag flag;
|
||||
/// Calculate rows before limit here to avoid race.
|
||||
std::call_once(flag, []() { profile_info.getRowsBeforeLimit(); });
|
||||
|
||||
return profile_info;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user