Skip to content

Commit

Permalink
fix(core): task restore interrupt problem on restart server (apache#2401
Browse files Browse the repository at this point in the history
)

* Update StandardTaskScheduler.java
  • Loading branch information
xiaoleizi2016 authored and VGalaxies committed Jan 12, 2024
1 parent 9dc38f7 commit 6349466
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ private TaskTransaction tx() {
@Override
public <V> void restoreTasks() {
Id selfServer = this.serverManager().selfNodeId();
List<HugeTask<V>> taskList = new ArrayList<>();
// Restore 'RESTORING', 'RUNNING' and 'QUEUED' tasks in order.
for (TaskStatus status : TaskStatus.PENDING_STATUSES) {
String page = this.supportsPaging() ? PageInfo.PAGE_NONE : null;
Expand All @@ -147,14 +148,18 @@ public <V> void restoreTasks() {
iter.hasNext();) {
HugeTask<V> task = iter.next();
if (selfServer.equals(task.server())) {
this.restore(task);
taskList.add(task);
}
}
if (page != null) {
page = PageInfo.pageInfo(iter);
}
} while (page != null);
}
for (HugeTask<V> task : taskList){
LOG.info("restore task {}", task);
this.restore(task);
}
}

private <V> Future<?> restore(HugeTask<V> task) {
Expand Down

0 comments on commit 6349466

Please sign in to comment.