-
Notifications
You must be signed in to change notification settings - Fork 527
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
Changes from 1 commit
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 |
---|---|---|
|
@@ -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; | ||
|
@@ -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
|
||
} | ||
} | ||
if (page != null) { | ||
page = PageInfo.pageInfo(iter); | ||
} | ||
} while (page != null); | ||
} | ||
for (HugeTask<V> task : taskList){ | ||
LOG.info("restore task {}",task ); | ||
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. expect the space after "," |
||
this.restore(task); | ||
} | ||
Check warning on line 166 in hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java
|
||
} | ||
|
||
private <V> Future<?> restore(HugeTask<V> task) { | ||
|
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.
we may fix this bug by changing the order of PENDING_STATUSES elements