Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#7969
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
yibin87 authored and ti-chi-bot committed Aug 22, 2023
1 parent d8cb780 commit 79c58b9
Show file tree
Hide file tree
Showing 4 changed files with 1,597 additions and 0 deletions.
23 changes: 23 additions & 0 deletions dbms/src/Flash/Mpp/MPPTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,31 @@ void MPPTask::writeErrToAllTunnels(const String & e)

void MPPTask::cancel(const String & reason)
{
<<<<<<< HEAD
CPUAffinityManager::getInstance().bindSelfQueryThread();
LOG_WARNING(log, "Begin cancel task: " + id.toString());
=======
/// Not call abortMPPGather to avoid issue https://github.com/pingcap/tiflash/issues/7177
// auto updated_msg = fmt::format("From {}: {}", id.toString(), error_msg);
//manager->abortMPPGather(id.gather_id, updated_msg, AbortType::ONERROR);
abort(error_msg, AbortType::ONERROR);
}

void MPPTask::abort(const String & message, AbortType abort_type)
{
auto abort_type_string = magic_enum::enum_name(abort_type);
TaskStatus next_task_status;
switch (abort_type)
{
case AbortType::ONCANCELLATION:
next_task_status = CANCELLED;
break;
case AbortType::ONERROR:
next_task_status = FAILED;
break;
}
LOG_WARNING(log, "Begin abort task: {}, abort type: {}", id.toString(), abort_type_string);
>>>>>>> bccc345b8a (Not call abortMPPGather when mpp task met error (#7969))
while (true)
{
auto previous_status = status.load();
Expand Down
Loading

0 comments on commit 79c58b9

Please sign in to comment.