-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refine cancel for read thread stream #8511
Conversation
Co-authored-by: Liqi Geng <gengliqiii@gmail.com>
task_pool->decreaseUnorderedInputStreamRefCount(); | ||
LOG_DEBUG(log, "Destroy, pool_id={} ref_no={}", task_pool->pool_id, ref_no); | ||
} | ||
void cancel(bool /*kill*/) override { decreaseRefCount(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you call cancel
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
called here
tiflash/dbms/src/Flash/Mpp/MPPTask.cpp
Lines 183 to 190 in 5417d84
void MPPTask::abortQueryExecutor() | |
{ | |
if (auto query_executor = query_executor_holder.tryGet(); query_executor) | |
{ | |
assert(query_executor.value()); | |
(*query_executor)->cancel(); | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiflash/dbms/src/Flash/Executor/DataStreamExecutor.cpp
Lines 61 to 65 in 5417d84
void DataStreamExecutor::cancel() | |
{ | |
if (auto * p_stream = dynamic_cast<IProfilingBlockInputStream *>(data_stream.get()); p_stream) | |
p_stream->cancel(/*kill=*/false); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiflash/dbms/src/DataStreams/MultiplexInputStream.h
Lines 157 to 173 in 5417d84
void cancel(bool kill) override | |
{ | |
if (kill) | |
is_killed = true; | |
bool old_val = false; | |
if (!is_cancelled.compare_exchange_strong(old_val, true, std::memory_order_seq_cst, std::memory_order_relaxed)) | |
return; | |
if (cur_stream) | |
{ | |
if (auto * child = dynamic_cast<IProfilingBlockInputStream *>(&*cur_stream)) | |
{ | |
child->cancel(kill); | |
} | |
} | |
} |
It seems that
cancel
will not be called for UnorderedInputStream
in shared_pool
.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gengliqi, JinheLin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@SeaRise: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests
If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
This reverts commit adf8569.
What problem does this PR solve?
Issue Number: ref #8505
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note