-
Notifications
You must be signed in to change notification settings - Fork 504
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 task-cancel error with saving failure task #827
Conversation
Codecov Report
@@ Coverage Diff @@
## master #827 +/- ##
============================================
+ Coverage 69.07% 72.16% +3.09%
- Complexity 4276 4447 +171
============================================
Files 286 287 +1
Lines 21085 21167 +82
Branches 2967 2989 +22
============================================
+ Hits 14565 15276 +711
+ Misses 5086 4387 -699
- Partials 1434 1504 +70
Continue to review full report at Codecov.
|
94af655
to
d32a600
Compare
Change-Id: If70a2233f73c578f38842b6b015241b5ba6b86a1
Change-Id: Ia47213935de8b76691e65098e95989b152bfb4b1
Change-Id: I57bdf5eb72ccebcde186b20ee079442236d4584d
Change-Id: I0adde8d686ca10b938c2660446463fa26fd4bb89
Change-Id: I0ac694d21ea5cbdf1234490afb2afda660f1349c
Change-Id: I1a2acadd27ee7820d240c3f987b8e061c2441e55
Change-Id: I606d389f06b2f8145463586308981f741c908ac0
Change-Id: Ice0ea021096bc86046dbe6621b72c26a892ce215
@@ -50,7 +50,11 @@ public String type() { | |||
|
|||
@Override | |||
public Object execute() { | |||
this.rebuildIndex(this.schemaElement()); | |||
SchemaElement schema = this.schemaElement(); |
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.
When will the schema be null
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.
Maybe the schema is removed when task running, I'm not quite sure of the exact scene.
public Integer call() throws Exception { | ||
Thread.sleep(SLEEP_TIME); | ||
return 125; | ||
} |
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.
add empty line
Change-Id: Ib9a26b1851b8477da8c20df77a19a4a2c9589a34
HugeGraph graph = graph(); | ||
TaskScheduler scheduler = graph.taskScheduler(); | ||
|
||
TaskCallable<Integer> callable = new TaskCallable<Integer>() { |
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.
= new
HugeGraph graph = graph(); | ||
TaskScheduler scheduler = graph.taskScheduler(); | ||
|
||
TaskCallable<Integer> callable = new TaskCallable<Integer>() { |
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.
ditto
|
||
@After | ||
@Override | ||
public void setup() { |
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.
teardown may be better
Change-Id: Idb4fe8d349c09d0384705641b27efddef10f44c2
Assert.assertTrue(task.result(), task.result() == null || | ||
task.result().endsWith("InterruptedException")); | ||
|
||
// cancel success 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.
// Cancel success task
Change-Id: Ib61c8cdae2e73d346dd611791d47faa30eac6e5a
This bug is caused by failure task status has not been saved to backend store(
the root cause is result size exceeded 64k, and failed to save), so its status is
still RUNNING even the task is finished, if call cancel() then the task will be loaded
from backend store and its scheduler is null.
fix apache/incubator-hugegraph-tools#50
Change-Id: If70a2233f73c578f38842b6b015241b5ba6b86a1