You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2019/08/09 00:38:03 UTC
[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request
#2702: [GOBBLIN-847] Flow level sla
sv2000 commented on a change in pull request #2702: [GOBBLIN-847] Flow level sla
URL: https://github.com/apache/incubator-gobblin/pull/2702#discussion_r312293108
##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java
##########
@@ -530,6 +529,44 @@ private void pollAndAdvanceDag()
}
}
+ private ExecutionStatus getJobExcecutionStatus(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 this job. If it is, tries to cancel the job if 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();
+ long flowSla = DagManagerUtils.getFlowSla(node);
+
+ if (flowSla != -1L && currentTime > flowStartTime + flowSla) {
+ log.info("Job exceeded the SLA of {} ms. Killing it now...", flowSla);
+ cancelDag(DagManagerUtils.generateDagId(node));
+ if (this.eventSubmitter.isPresent()) {
+ JobExecutionPlan jobExecutionPlan = DagManagerUtils.getJobExecutionPlan(node);
+ Map<String, String> jobMetadata = TimingEventUtils.getJobMetadata(Maps.newHashMap(), jobExecutionPlan);
+ this.eventSubmitter.get().getTimingEvent(TimingEvent.LauncherTimings.JOB_CANCEL).stop(jobMetadata);
Review comment:
I don't think sending JOB_CANCEL timer event is right. We should be sending a new timer event FLOW_CANCEL since we have cancelled the entire flow.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services