Will-Lo commented on code in PR #3639:
URL: https://github.com/apache/gobblin/pull/3639#discussion_r1100616376


##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java:
##########
@@ -251,10 +251,17 @@ static void 
addJobStatusToStateStore(org.apache.gobblin.configuration.State jobS
         int currentGeneration = 
jobStatus.getPropAsInt(TimingEvent.FlowEventConstants.CURRENT_GENERATION_FIELD, 
previousGeneration);
         int previousAttempts = 
previousJobStatus.getPropAsInt(TimingEvent.FlowEventConstants.CURRENT_ATTEMPTS_FIELD,
 1);
         int currentAttempts = 
jobStatus.getPropAsInt(TimingEvent.FlowEventConstants.CURRENT_ATTEMPTS_FIELD, 
previousAttempts);
+        // Verify if the current job status is flow status. If yes, we check 
for its current execution status to be PENDING_RESUME (limiting to just resume 
flow statuses)
+        // When the above two conditions satisfy, we NEED NOT check for the 
out-of-order events since GaaS would manage the lifecycle of these events
+        // Hence, we update the merge state so that the flow can proceed with 
its execution
+        if (jobName != null && jobGroup != null
+            && jobName.equals(JobStatusRetriever.NA_KEY) && 
jobGroup.equals(JobStatusRetriever.NA_KEY) && 
currentStatus.equals(ExecutionStatus.PENDING_RESUME.name())) {

Review Comment:
   can we abstract this check into a function similar to how JobStatusRetriever 
has this check?



##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java:
##########
@@ -251,10 +251,17 @@ static void 
addJobStatusToStateStore(org.apache.gobblin.configuration.State jobS
         int currentGeneration = 
jobStatus.getPropAsInt(TimingEvent.FlowEventConstants.CURRENT_GENERATION_FIELD, 
previousGeneration);
         int previousAttempts = 
previousJobStatus.getPropAsInt(TimingEvent.FlowEventConstants.CURRENT_ATTEMPTS_FIELD,
 1);
         int currentAttempts = 
jobStatus.getPropAsInt(TimingEvent.FlowEventConstants.CURRENT_ATTEMPTS_FIELD, 
previousAttempts);
+        // Verify if the current job status is flow status. If yes, we check 
for its current execution status to be PENDING_RESUME (limiting to just resume 
flow statuses)
+        // When the above two conditions satisfy, we NEED NOT check for the 
out-of-order events since GaaS would manage the lifecycle of these events
+        // Hence, we update the merge state so that the flow can proceed with 
its execution
+        if (jobName != null && jobGroup != null
+            && jobName.equals(JobStatusRetriever.NA_KEY) && 
jobGroup.equals(JobStatusRetriever.NA_KEY) && 
currentStatus.equals(ExecutionStatus.PENDING_RESUME.name())) {

Review Comment:
   Also, since the side effect of this change is similar to the else case, 
would it be simpler for us to append to the previous if statement and make an 
initial check that the currentStatus != a flow status and pending resume?



-- 
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