-
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
Scheduler no throw in destruction and avoid updated min-tso query hang #4367
Changes from 3 commits
384e5a3
047467b
0dcb23f
dd8a111
e1baca3
3e563cc
419124b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -426,13 +426,16 @@ void MPPTask::scheduleOrWait() | |
{ | ||
LOG_FMT_INFO(log, "task waits for schedule"); | ||
Stopwatch stopwatch; | ||
double time_cost; | ||
{ | ||
std::unique_lock lock(schedule_mu); | ||
schedule_cv.wait(lock, [&] { return schedule_state != ScheduleState::WAITING; }); | ||
time_cost = stopwatch.elapsedSeconds(); | ||
GET_METRIC(tiflash_task_scheduler_waiting_duration_seconds).Observe(time_cost); | ||
if (schedule_state == ScheduleState::FAILED) | ||
{ | ||
throw Exception("{} is failed to schedule.", id.toString()); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not throw error if the schedule state is FAILED? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the later processing in MppTask->runImp() will throw because this query is to be cancelled, whose state is not RUNNING.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But after the task is scheduled with
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated to this goal. |
||
} | ||
auto time_cost = stopwatch.elapsedSeconds(); | ||
GET_METRIC(tiflash_task_scheduler_waiting_duration_seconds).Observe(time_cost); | ||
LOG_FMT_INFO(log, "task waits for {} s to schedule and starts to run in parallel.", time_cost); | ||
} | ||
} | ||
|
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.
I would like to distinguish the cases that task is failed to schedule due to resource exhausted or due to the related query is cancelled.
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.
ok, I will add a enum flagh: EXCEEDED