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

fix(core): task restore interrupt problem on restart server #2401

Merged
merged 3 commits into from
Dec 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
@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 @@ -151,14 +152,18 @@
iter.hasNext();) {
HugeTask<V> task = iter.next();
if (selfServer.equals(task.server())) {
this.restore(task);
taskList.add(task);

Check warning on line 155 in hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java

View check run for this annotation

Codecov / codecov/patch

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java#L155

Added line #L155 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may fix this bug by changing the order of PENDING_STATUSES elements

}
}
if (page != null) {
page = PageInfo.pageInfo(iter);
}
} while (page != null);
}
for (HugeTask<V> task : taskList){
LOG.info("restore task {}", task);
this.restore(task);
}

Check warning on line 166 in hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java

View check run for this annotation

Codecov / codecov/patch

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java#L164-L166

Added lines #L164 - L166 were not covered by tests
}

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