arjun4084346 commented on a change in pull request #2923: [GOBBLIN-1083] Unit 
test improving & return failed when helix task cancelled
URL: https://github.com/apache/incubator-gobblin/pull/2923#discussion_r404622306
 
 

 ##########
 File path: 
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/task/BaseAbstractTask.java
 ##########
 @@ -91,4 +94,13 @@ public String getProgress() {
   public boolean isSpeculativeExecutionSafe() {
     return false;
   }
+
+  /**
+   * Similar to org.apache.gobblin.runtime.Task#failTask(java.lang.Throwable), 
we need to propagate exception thrown
+   * in workunit level by setting {@link 
ConfigurationKeys#TASK_FAILURE_EXCEPTION_KEY}
+   */
+  protected void failTask(Throwable t, TaskContext taskContext) {
+    
taskContext.getTaskState().setWorkingState(WorkUnitState.WorkingState.FAILED);
+    
taskContext.getTaskState().setProp(ConfigurationKeys.TASK_FAILURE_EXCEPTION_KEY,
 Throwables.getStackTraceAsString(t));
+  }
 
 Review comment:
   No failureEvent here?
   Is there a reasonable way to not have duplicate code?

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


With regards,
Apache Git Services

Reply via email to