umustafi commented on code in PR #4013:
URL: https://github.com/apache/gobblin/pull/4013#discussion_r1702192349


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/spec/JobExecutionPlanListSerializer.java:
##########
@@ -82,6 +82,8 @@ public JsonElement serialize(List<JobExecutionPlan> src, Type 
typeOfSrc, JsonSer
 
       String executionStatus = jobExecutionPlan.getExecutionStatus().name();
       
jobExecutionPlanJson.addProperty(SerializationConstants.EXECUTION_STATUS_KEY, 
executionStatus);
+      
jobExecutionPlanJson.addProperty(SerializationConstants.CURRENT_GENERATION_KEY, 
jobExecutionPlan.getCurrentGeneration());

Review Comment:
   are these two fields always present in jobExecutionPlan or do they need a 
default value?



##########
gobblin-service/src/test/java/org/apache/gobblin/service/modules/orchestration/proc/ReevaluateDagProcTest.java:
##########
@@ -263,6 +262,47 @@ public void testMultipleNextJobToRun() throws Exception {
     specProducers.forEach(sp -> Mockito.verify(sp, 
Mockito.never()).addSpec(any()));
   }
 
+  @Test
+  public void testRetryCurrentFailedJob() throws Exception {
+    String flowName = "fn5";
+    Dag<JobExecutionPlan> dag = DagManagerTest.buildDag("1", flowExecutionId, 
DagManager.FailureOption.FINISH_ALL_POSSIBLE.name(),
+        2, "user5", ConfigFactory.empty()
+            .withValue(ConfigurationKeys.FLOW_GROUP_KEY, 
ConfigValueFactory.fromAnyRef(flowGroup))
+            .withValue(ConfigurationKeys.FLOW_NAME_KEY, 
ConfigValueFactory.fromAnyRef(flowName))
+            .withValue(ConfigurationKeys.JOB_GROUP_KEY, 
ConfigValueFactory.fromAnyRef(flowGroup))
+            .withValue(ConfigurationKeys.SPECEXECUTOR_INSTANCE_URI_KEY, 
ConfigValueFactory.fromAnyRef(
+                MySqlDagManagementStateStoreTest.TEST_SPEC_EXECUTOR_URI))
+    );
+    List<SpecProducer<Spec>> specProducers = getDagSpecProducers(dag);
+    dagManagementStateStore.addDag(dag);
+    // a job status with shouldRetry=true
+    JobStatus jobStatus = 
JobStatus.builder().flowName(flowName).flowGroup(flowGroup).jobGroup(flowGroup)
+        .jobName("job0").flowExecutionId(flowExecutionId).message("Test 
message").eventName(ExecutionStatus.FAILED.name())
+        
.startTime(flowExecutionId).shouldRetry(true).orchestratedTime(flowExecutionId).build();
+    doReturn(new ImmutablePair<>(Optional.of(dag.getNodes().get(0)), 
Optional.of(jobStatus)))
+        .when(dagManagementStateStore).getDagNodeWithJobStatus(any());
+
+    ReevaluateDagProc
+        reEvaluateDagProc = new ReevaluateDagProc(new ReevaluateDagTask(new 
DagActionStore.DagAction(flowGroup, flowName,
+        flowExecutionId, "job0", DagActionStore.DagActionType.REEVALUATE), 
null,
+        dagManagementStateStore, mockedDagProcEngineMetrics));
+    reEvaluateDagProc.process(dagManagementStateStore, 
mockedDagProcEngineMetrics);
+
+    int numOfLaunchedJobs = 1; // only the current job
+    // only the current job should have run
+    Mockito.verify(specProducers.get(0), Mockito.times(1)).addSpec(any());
+
+    specProducers.stream().skip(numOfLaunchedJobs) // separately verified 
`specProducers.get(0)`

Review Comment:
   is this due to reevaluate dagProc relaunching the job? can u make that more 
clear with a comment this test is hard to follow bc of the detailed logic being 
tested here



##########
gobblin-runtime/src/main/java/org/apache/gobblin/service/monitoring/FlowStatusGenerator.java:
##########
@@ -41,7 +41,7 @@
 @Slf4j
 public class FlowStatusGenerator {
   public static final List<String> FINISHED_STATUSES = 
Lists.newArrayList(ExecutionStatus.FAILED.name(),
-      ExecutionStatus.COMPLETE.name(), ExecutionStatus.CANCELLED.name());
+      ExecutionStatus.COMPLETE.name(), ExecutionStatus.CANCELLED.name(), 
ExecutionStatus.PENDING_RETRY.name());

Review Comment:
   Why use this PENDING_RETRY status at all if Reevaluate is going to use the # 
of retry attempts to determine if anything to retry for the job? can you 
summarize how this particular status is used in the PR desc? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to