Fix bug where state is set twice when no workunits created
Closes from jack-moseley/empty-workunit-bug
@@ -558,8 +558,7 @@ public abstract class AbstractJobLauncher implements JobLauncher {
jobListener.onJobFailure(jobContext);
}
});
- }
-
+ } else {
for (JobState.DatasetState datasetState : this.jobContext.getDatasetStatesByUrns().values()) {
// Set the overall job state to FAILED if the job failed to process any dataset
if (datasetState.getState() == JobState.RunningState.FAILED) {
@@ -597,6 +596,7 @@ public abstract class AbstractJobLauncher implements JobLauncher {
}
}
}
+ }
} finally {
// Stop metrics reporting
if (this.jobContext.getJobMetricsOptional().isPresent()) {
