[ 
https://issues.apache.org/jira/browse/GOBBLIN-2121?focusedWorklogId=928754&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-928754
 ]

ASF GitHub Bot logged work on GOBBLIN-2121:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Aug/24 17:18
            Start Date: 05/Aug/24 17:18
    Worklog Time Spent: 10m 
      Work Description: umustafi commented on code in PR #4015:
URL: https://github.com/apache/gobblin/pull/4015#discussion_r1704419098


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/FlowLaunchHandler.java:
##########
@@ -120,6 +120,24 @@ && 
persistLaunchDagAction((LeaseAttemptStatus.LeaseObtainedStatus) leaseAttempt)
     }
   }
 
+  /**
+   * This method is used in the multi-active scheduler case for one or more 
hosts to respond to a kill dag action
+   * event triggered by the Orchestrator by attempting a lease for the kill 
event and processing the result depending on
+   * the status of the attempt.
+   */
+  public void handleFlowKillTriggerEvent(Properties jobProps, 
DagActionStore.LeaseParams leaseParams) throws IOException {
+    long previousEventTimeMillis = leaseParams.getEventTimeMillis();
+    LeaseAttemptStatus leaseAttempt = 
this.multiActiveLeaseArbiter.tryAcquireLease(leaseParams, false);
+    if (leaseAttempt instanceof LeaseAttemptStatus.LeaseObtainedStatus
+        && persistLaunchDagAction((LeaseAttemptStatus.LeaseObtainedStatus) 
leaseAttempt)) {
+      log.info("Successfully persisted lease: [{}, eventTimestamp: {}] ", 
leaseAttempt.getConsensusDagAction(),
+          previousEventTimeMillis);
+    } else { // when NOT successfully `persistDagAction`, set a reminder to 
re-attempt handling (unless leasing finished)
+      
calcLeasedToAnotherStatusForReminder(leaseAttempt).ifPresent(leasedToAnother ->
+          scheduleReminderForEvent(jobProps, leasedToAnother, 
previousEventTimeMillis));
+    }

Review Comment:
   can u extract common functionality with the event avoce for 
`handleFlowLaunchTriggerEvent`





Issue Time Tracking
-------------------

    Worklog Id:     (was: 928754)
    Time Spent: 4h  (was: 3h 50m)

>  redirect kill requests to dag proc engine
> ------------------------------------------
>
>                 Key: GOBBLIN-2121
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2121
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 4h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to