mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
Cancel PipelineExecutor properly in case of exception in spawnThreads
This commit is contained in:
parent
9fb1acc947
commit
e1904cbdf1
@ -300,8 +300,18 @@ void PipelineExecutor::executeStepImpl(size_t thread_num, std::atomic_bool * yie
|
||||
context.processing_time_ns += processing_time_watch.elapsed();
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
/// Upscale if possible.
|
||||
spawnThreads();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
/// spawnThreads can throw an exception, for example CANNOT_SCHEDULE_TASK.
|
||||
/// We should cancel execution properly before rethrow.
|
||||
cancel();
|
||||
throw;
|
||||
}
|
||||
|
||||
/// We have executed single processor. Check if we need to yield execution.
|
||||
if (yield_flag && *yield_flag)
|
||||
|
Loading…
Reference in New Issue
Block a user