Skip to content
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

Potential hang if duplicate task is registered #8192

Closed
windtalker opened this issue Oct 13, 2023 · 0 comments · Fixed by #8193
Closed

Potential hang if duplicate task is registered #8192

windtalker opened this issue Oct 13, 2023 · 0 comments · Fixed by #8193
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. component/compute severity/major type/bug The issue is confirmed as a bug.

Comments

@windtalker
Copy link
Contributor

windtalker commented Oct 13, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Consider the case that task 1 is registered, and TiDB send task 1 to TiFlash again due to some issue(for example, TiDB meet rpc deadline exceeded), then the second request will fail due to "task is already registered", and go through error handling process:

void MPPHandler::handleError(const MPPTaskPtr & task, String error)
{
if (task)
{
try
{
task->handleError(error);
}
catch (...)
{
tryLogCurrentException(log, "Fail to handle error and clean task");
}
task->unregisterTask();
}
}

In L67, it will unregister the task. Note this task is not registered yet, unregister task will unregister the first "task 1" from MPPTaskManager, in this case the subsequent cancel can't not see this task, so the first "task 1" may hang forever.

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. component/compute severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants