mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Added description of possible race condition [#CLICKHOUSE-2].
This commit is contained in:
parent
98ad6a5db3
commit
2c424c7989
@ -60,6 +60,23 @@ protected:
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(cancel_mutex);
|
||||
|
||||
/** TODO Data race here. See IProfilingBlockInputStream::collectAndSendTotalRowsApprox.
|
||||
Assume following pipeline:
|
||||
|
||||
RemoteBlockInputStream
|
||||
AsynchronousBlockInputStream
|
||||
LazyBlockInputStream
|
||||
|
||||
RemoteBlockInputStream calls AsynchronousBlockInputStream::readPrefix
|
||||
and AsynchronousBlockInputStream spawns a thread and returns.
|
||||
|
||||
The separate thread will call LazyBlockInputStream::read
|
||||
LazyBlockInputStream::read will add more children to itself
|
||||
|
||||
In the same moment, in main thread, RemoteBlockInputStream::read is called,
|
||||
then IProfilingBlockInputStream::collectAndSendTotalRowsApprox is called
|
||||
and iterates over set of children.
|
||||
*/
|
||||
children.push_back(input);
|
||||
|
||||
if (isCancelled() && p_input)
|
||||
|
Loading…
Reference in New Issue
Block a user