Skip to content

Commit

Permalink
[ML] Mark task as completed when DFA job is stopped while reindexing
Browse files Browse the repository at this point in the history
After elastic#54650 we catch `TaskCancelledException` when we wait for
reindexing to complete as it may be thrown. However, when that happens
we do not mark the task as completed. This results in the stop request
never returning and the failures we saw in elastic#55068.

Closes elastic#55068
  • Loading branch information
dimitris-athanasiou committed Apr 16, 2020
1 parent de30a0e commit c5535a1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ public void testLazyAssignmentWithModelMemoryLimitTooHighForAssignment() throws
"Stopped analytics");
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/55068")
public void testOutlierDetectionStopAndRestart() throws Exception {
String sourceIndex = "test-outlier-detection-stop-and-restart";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ private void reindexDataframeAndStartAnalysis(DataFrameAnalyticsTask task, DataF
if (error instanceof TaskCancelledException && task.isStopping()) {
LOGGER.debug(new ParameterizedMessage("[{}] Caught task cancelled exception while task is stopping",
config.getId()), error);
task.markAsCompleted();
} else {
task.setFailed(ExceptionsHelper.unwrapCause(error).getMessage());
}
Expand Down

0 comments on commit c5535a1

Please sign in to comment.