mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Merge pull request #42874 from azat/query-hung-on-cancel-fix
This commit is contained in:
commit
88033562cd
@ -109,6 +109,13 @@ bool ExecutingGraph::expandPipeline(std::stack<uint64_t> & stack, uint64_t pid)
|
||||
|
||||
{
|
||||
std::lock_guard guard(processors_mutex);
|
||||
/// Do not add new processors to existing list, since the query was already cancelled.
|
||||
if (cancelled)
|
||||
{
|
||||
for (auto & processor : new_processors)
|
||||
processor->cancel();
|
||||
return false;
|
||||
}
|
||||
processors->insert(processors->end(), new_processors.begin(), new_processors.end());
|
||||
}
|
||||
|
||||
@ -388,6 +395,7 @@ void ExecutingGraph::cancel()
|
||||
std::lock_guard guard(processors_mutex);
|
||||
for (auto & processor : *processors)
|
||||
processor->cancel();
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -157,6 +157,7 @@ private:
|
||||
UpgradableMutex nodes_mutex;
|
||||
|
||||
const bool profile_processors;
|
||||
bool cancelled = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user