Fix data race in PipelineExecutor.

This commit is contained in:
Nikolai Kochetov 2019-05-13 13:03:47 +03:00
parent b8adb0937f
commit 18a7b0d7a2
2 changed files with 3 additions and 3 deletions

View File

@ -188,7 +188,7 @@ void PipelineExecutor::addJob(UInt64 pid, ThreadPool * pool)
{
if (pool)
{
auto job = [this, pid]()
auto job = [this, pid, processor = graph[pid].processor]()
{
SCOPE_EXIT(
{
@ -198,7 +198,7 @@ void PipelineExecutor::addJob(UInt64 pid, ThreadPool * pool)
event_counter.notify()
);
executeJob(graph[pid].processor);
executeJob(processor);
};
pool->schedule(createExceptionHandledJob(std::move(job), exception_handler));

View File

@ -82,7 +82,7 @@ void IAccumulatingTransform::setReadyChunk(Chunk chunk)
{
if (current_output_chunk)
throw Exception("IAccumulatingTransform already has input. Cannot set another chunk. "
"Probably, setReadyChunk method was called twose per consume().", ErrorCodes::LOGICAL_ERROR);
"Probably, setReadyChunk method was called twice per consume().", ErrorCodes::LOGICAL_ERROR);
current_output_chunk = std::move(chunk);
}