diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java index 120aeb0d66..99b7e8cb7f 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java @@ -142,6 +142,7 @@ private TaskTransaction tx() { @Override public void restoreTasks() { Id selfServer = this.serverManager().selfNodeId(); + List> 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; @@ -151,7 +152,7 @@ public void restoreTasks() { iter.hasNext();) { HugeTask task = iter.next(); if (selfServer.equals(task.server())) { - this.restore(task); + taskList.add(task); } } if (page != null) { @@ -159,6 +160,10 @@ public void restoreTasks() { } } while (page != null); } + for (HugeTask task : taskList){ + LOG.info("restore task {}", task); + this.restore(task); + } } private Future restore(HugeTask task) {