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

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

                Author: ASF GitHub Bot
            Created on: 13/Aug/19 04:34
            Start Date: 13/Aug/19 04:34
    Worklog Time Spent: 10m 
      Work Description: sv2000 commented on pull request #2702: [GOBBLIN-847] 
Flow level sla
URL: https://github.com/apache/incubator-gobblin/pull/2702#discussion_r313215701
 
 

 ##########
 File path: 
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java
 ##########
 @@ -530,6 +545,48 @@ private void pollAndAdvanceDag()
       }
     }
 
+    private ExecutionStatus getJobExecutionStatus(boolean slaKilled, JobStatus 
jobStatus) {
+      if (slaKilled) {
+        return CANCELLED;
+      } else {
+        if (jobStatus == null) {
+          return PENDING;
+        } else {
+          return valueOf(jobStatus.getEventName());
+        }
+      }
+    }
+
+    /**
+     * Check if the SLA is configured for the flow this job belongs to.
+     * If it is, this method will try to cancel the job when SLA is reached.
+     *
+     * @param node dag node of the job
+     * @return true if the job is killed because it reached sla
+     * @throws ExecutionException exception
+     * @throws InterruptedException exception
+     */
+    private boolean slaKillIfNeeded(DagNode<JobExecutionPlan> node) throws 
ExecutionException, InterruptedException {
+      long flowStartTime = DagManagerUtils.getFlowStartTime(node);
+      long currentTime = System.currentTimeMillis();
+      String dagId = DagManagerUtils.generateDagId(node);
+
+      long flowSla;
+      if (dagToSLA.containsKey(dagId)) {
+        flowSla = dagToSLA.get(dagId);
+      } else {
+        flowSla = DagManagerUtils.getFlowSLA(node);
+        dagToSLA.put(dagId, flowSla);
+      }
+
+      if (flowSla != DagManagerUtils.NO_SLA && currentTime > flowStartTime + 
flowSla) {
+        log.info("Job exceeded the SLA of {} ms. Killing it now...", flowSla);
 
 Review comment:
   log.info("Flow exceeded the SLA...")?
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 293597)
    Time Spent: 3.5h  (was: 3h 20m)

> add a flow level sla in gaas flows
> ----------------------------------
>
>                 Key: GOBBLIN-847
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-847
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> add a flow level sla in gaas flows, because sometimes azkaban jobs may not 
> start and hence send any tracking event, or azkaban maybe down. in all those 
> cases, we might have to kill the job so we can start a new job



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to