mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge pull request #48687 from ClickHouse/processor-call-oncancel-once
Call IProcessor::onCancel() once
This commit is contained in:
commit
44f05e3fca
@ -237,11 +237,12 @@ public:
|
||||
|
||||
/// In case if query was cancelled executor will wait till all processors finish their jobs.
|
||||
/// Generally, there is no reason to check this flag. However, it may be reasonable for long operations (e.g. i/o).
|
||||
bool isCancelled() const { return is_cancelled; }
|
||||
bool isCancelled() const { return is_cancelled.load(std::memory_order_acquire); }
|
||||
void cancel()
|
||||
{
|
||||
is_cancelled = true;
|
||||
onCancel();
|
||||
bool already_cancelled = is_cancelled.exchange(true, std::memory_order_acq_rel);
|
||||
if (!already_cancelled)
|
||||
onCancel();
|
||||
}
|
||||
|
||||
/// Additional method which is called in case if ports were updated while work() method.
|
||||
|
Loading…
Reference in New Issue
Block a user