Skip to content

Commit b332674

Browse files
committed
fix(server): fix some issues of the distributed scheduler
1 parent af85bef commit b332674

3 files changed

Lines changed: 163 additions & 163 deletions

File tree

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/DistributedTaskScheduler.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,14 +357,10 @@ protected <V> HugeTask<V> deleteFromDB(Id id) {
357357
public <V> HugeTask<V> delete(Id id, boolean force) {
358358
HugeTask<?> task = this.taskWithoutResult(id);
359359

360-
if (!force) {
360+
if (!force && !task.completed() && task.status() != TaskStatus.DELETING) {
361361
// Check task status: can't delete running tasks without force
362-
if (!task.completed() && task.status() != TaskStatus.DELETING) {
363-
throw new IllegalArgumentException(
364-
String.format("Can't delete incomplete task '%s' in status %s, " +
365-
"Please try to cancel the task first",
366-
id, task.status()));
367-
}
362+
this.updateStatus(id, null, TaskStatus.DELETING);
363+
return null;
368364
// Already in DELETING status, delete directly from DB
369365
// Completed tasks can also be deleted directly
370366
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ public <V> V call(Callable<V> callable) {
578578
}
579579
}
580580

581+
@Deprecated
581582
private void checkOnMasterNode(String op) {
582583
// Single-node mode: all operations are allowed, no role check needed
583584
}

0 commit comments

Comments
 (0)