Throw an exception if job orchestration fails on a SpecExecutor.[]
Closes from sv2000/AzkabanClientStatus
@@ -393,7 +393,11 @@ public class DagManager extends AbstractIdleService {
TimingEvent jobOrchestrationTimer = this.eventSubmitter.isPresent() ? this.eventSubmitter.get().
getTimingEvent(TimingEvent.LauncherTimings.JOB_ORCHESTRATED) : null;
- producer.addSpec(jobSpec);
+ //Submit the job to the SpecProducer, which in turn performs the actual job submission to the SpecExecutor instance.
+ // The SpecProducer implementations submit the job to the underlying executor and return when the submission is complete,
+ // either successfully or unsuccessfully. To catch any exceptions in the job submission, the DagManagerThread
+ // blocks (by calling Future#get()) until the submission is completed.
+ producer.addSpec(jobSpec).get();
if (jobOrchestrationTimer != null) {
jobOrchestrationTimer.stop(jobMetadata);
