mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
tasks: fail if a task was aborted
run() method of task_manager::task::impl does not have to throw when a task is aborted with task manager api. Thus, a user will see that the task finished successfully which makes it inconsistent. Finish a task with a failure if it was aborted with task manager api.
This commit is contained in:
@@ -124,7 +124,12 @@ void task_manager::task::impl::run_to_completion() {
|
||||
if (f.failed()) {
|
||||
finish_failed(f.get_exception());
|
||||
} else {
|
||||
finish();
|
||||
try {
|
||||
_as.check();
|
||||
finish();
|
||||
} catch (...) {
|
||||
finish_failed(std::current_exception());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user