[ML] Having no datafeed tasks can happen.

Original commit: elastic/x-pack-elasticsearch@b752ce4f0f
This commit is contained in:
Martijn van Groningen 2017-04-19 16:49:00 +02:00
parent 4255f6dae6
commit 06c4a3223b
2 changed files with 4 additions and 5 deletions

View File

@ -391,8 +391,7 @@ public class CloseJobAction extends Action<CloseJobAction.Request, CloseJobActio
} else {
// This can happen we the actual task in the node no longer exists,
// which means the job(s) have already been closed.
// returning false, here because the current close request hasn't actually closed anything.
return new Response(false);
return new Response(true);
}
}

View File

@ -400,9 +400,9 @@ public class StopDatafeedAction
throw org.elasticsearch.ExceptionsHelper
.convertToElastic(failedNodeExceptions.get(0));
} else {
throw new IllegalStateException(
"Expected [" + request.getResolvedDatafeedIds().length
+ "] number of tasks but " + "got [" + tasks.size() + "]");
// This can happen we the actual task in the node no longer exists,
// which means the datafeed(s) have already been closed.
return new Response(true);
}
}