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 task-cancel error with saving failure task #827

Merged
merged 13 commits into from
Feb 24, 2020
Merged

fix task-cancel error with saving failure task #827

merged 13 commits into from
Feb 24, 2020

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Jan 13, 2020

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

@javeme javeme changed the title fix task-cancel error with failure task when saving fix task-cancel error with saving failure task Jan 13, 2020
@codecov
Copy link

codecov bot commented Jan 14, 2020

Codecov Report

Merging #827 into master will increase coverage by 3.09%.
The diff coverage is 78.2%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
...aidu/hugegraph/backend/serializer/BytesBuffer.java 88.88% <ø> (ø) 169 <0> (ø) ⬇️
.../hugegraph/backend/store/BackendEntryIterator.java 61.01% <0%> (ø) 17 <0> (ø) ⬇️
.../main/java/com/baidu/hugegraph/job/JobBuilder.java 100% <100%> (ø) 12 <0> (ø) ⬇️
...egraph/traversal/optimize/HugeScriptTraversal.java 78.04% <100%> (ø) 5 <0> (ø) ⬇️
...n/java/com/baidu/hugegraph/api/job/GremlinAPI.java 17.39% <20%> (-32.12%) 0 <0> (ø)
...main/java/com/baidu/hugegraph/api/job/TaskAPI.java 53.19% <40%> (+9.71%) 0 <0> (ø) ⬇️
...idu/hugegraph/job/schema/RebuildIndexCallable.java 84.72% <50%> (-2.24%) 21 <1> (+1)
...c/main/java/com/baidu/hugegraph/task/HugeTask.java 71.31% <67.39%> (+6.25%) 65 <20> (+17) ⬆️
...ore/src/main/java/com/baidu/hugegraph/job/Job.java 71.87% <77.77%> (+26.04%) 8 <2> (+4) ⬆️
...c/main/java/com/baidu/hugegraph/HugeException.java 92.3% <80%> (-7.7%) 6 <2> (+2)
... and 43 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5952dc3...e63d352. Read the comment docs.

@javeme javeme force-pushed the task-bug branch 2 times, most recently from 94af655 to d32a600 Compare January 16, 2020 12:02
Change-Id: If70a2233f73c578f38842b6b015241b5ba6b86a1
Change-Id: I906039eca6b88dc450ee7adac36fe1e3d252be61
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();
Copy link
Contributor

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

Copy link
Contributor Author

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;
}
Copy link
Contributor

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
Linary
Linary previously approved these changes Feb 21, 2020
HugeGraph graph = graph();
TaskScheduler scheduler = graph.taskScheduler();

TaskCallable<Integer> callable = new TaskCallable<Integer>() {
Copy link
Contributor

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>() {
Copy link
Contributor

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() {
Copy link
Contributor

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: Ic02398d5c8310510ae3524407f2fbf9ef1801135
Change-Id: Idb4fe8d349c09d0384705641b27efddef10f44c2
Assert.assertTrue(task.result(), task.result() == null ||
task.result().endsWith("InterruptedException"));

// cancel success task
Copy link
Contributor

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
@Linary Linary merged commit dee579d into master Feb 24, 2020
@Linary Linary deleted the task-bug branch February 24, 2020 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

task-cancel failed when task is running
3 participants