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


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/proc/DagProcUtils.java:
##########
@@ -193,15 +194,33 @@ public static void sendCancellationEvent(JobExecutionPlan 
jobExecutionPlan) {
 
   private static void 
sendEnforceJobStartDeadlineDagAction(DagManagementStateStore 
dagManagementStateStore, Dag.DagNode<JobExecutionPlan> dagNode)
       throws IOException {
-    dagManagementStateStore.addJobDagAction(dagNode.getValue().getFlowGroup(), 
dagNode.getValue().getFlowName(),
-        dagNode.getValue().getFlowExecutionId(), 
dagNode.getValue().getJobName(),
+    DagActionStore.DagAction dagAction = new 
DagActionStore.DagAction(dagNode.getValue().getFlowGroup(),
+        dagNode.getValue().getFlowName(), 
dagNode.getValue().getFlowExecutionId(), dagNode.getValue().getJobName(),
         DagActionStore.DagActionType.ENFORCE_JOB_START_DEADLINE);
+    try {
+      dagManagementStateStore.addDagAction(dagAction);
+    } catch (IOException e) {
+      if (e.getCause() != null && e.getCause() instanceof 
SQLIntegrityConstraintViolationException) {
+        dagManagementStateStore.deleteDagAction(dagAction);

Review Comment:
   for the metrics on startup it will show up as several deletions and 
additions but I think this is ok. no negative values



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