[ml] Fix start datafeed validation

relates elastic/x-pack-elasticsearch#596

Original commit: elastic/x-pack-elasticsearch@103fd7f2b4
This commit is contained in:
Martijn van Groningen 2017-02-17 20:14:08 +01:00
parent 92a4b97f6d
commit 22022ea25f
1 changed files with 0 additions and 4 deletions

View File

@ -346,10 +346,6 @@ public class StartDatafeedAction
throw ExceptionsHelper.missingJobException(datafeed.getJobId()); throw ExceptionsHelper.missingJobException(datafeed.getJobId());
} }
DatafeedJobValidator.validate(datafeed, job); DatafeedJobValidator.validate(datafeed, job);
if (tasks == null) {
return;
}
JobState jobState = MlMetadata.getJobState(datafeed.getJobId(), tasks); JobState jobState = MlMetadata.getJobState(datafeed.getJobId(), tasks);
if (jobState != JobState.OPENED) { if (jobState != JobState.OPENED) {
throw new ElasticsearchStatusException("cannot start datafeed, expected job state [{}], but got [{}]", throw new ElasticsearchStatusException("cannot start datafeed, expected job state [{}], but got [{}]",