You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gobblin.apache.org by su...@apache.org on 2020/07/16 01:50:31 UTC

[incubator-gobblin] branch master updated: [GOBBLIN-1213] Skip job state deserialization during SingleFailInCreat…

This is an automated email from the ASF dual-hosted git repository.

suvasude pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-gobblin.git


The following commit(s) were added to refs/heads/master by this push:
     new 3b2d382  [GOBBLIN-1213] Skip job state deserialization during SingleFailInCreat…
3b2d382 is described below

commit 3b2d3823da53e55a213d8aeb81fa2fb579ee8f3f
Author: sv2000 <su...@gmail.com>
AuthorDate: Wed Jul 15 18:50:25 2020 -0700

    [GOBBLIN-1213] Skip job state deserialization during SingleFailInCreat…
    
    Closes #3061 from
    sv2000/singleFailInTaskCreateFailure
---
 .../gobblin/cluster/SingleFailInCreationTask.java     |  3 ++-
 .../java/org/apache/gobblin/cluster/SingleTask.java   | 19 ++++++++++++++-----
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleFailInCreationTask.java b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleFailInCreationTask.java
index c0b3409..2a4105c 100644
--- a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleFailInCreationTask.java
+++ b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleFailInCreationTask.java
@@ -36,7 +36,8 @@ import org.apache.gobblin.runtime.util.StateStores;
 public class SingleFailInCreationTask extends SingleTask {
   public SingleFailInCreationTask(String jobId, Path workUnitFilePath, Path jobStateFilePath, FileSystem fs,
       TaskAttemptBuilder taskAttemptBuilder, StateStores stateStores, Config dynamicConfig) {
-    super(jobId, workUnitFilePath, jobStateFilePath, fs, taskAttemptBuilder, stateStores, dynamicConfig);
+    //Since this is a dummy task that is designed to fail immediately on run(), we skip fetching the job state.
+    super(jobId, workUnitFilePath, jobStateFilePath, fs, taskAttemptBuilder, stateStores, dynamicConfig, true);
   }
 
   @Override
diff --git a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleTask.java b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleTask.java
index 47571a2..b4397f1 100644
--- a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleTask.java
+++ b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleTask.java
@@ -77,12 +77,17 @@ public class SingleTask {
   private Condition _taskAttemptBuilt;
   private Lock _lock;
 
+  SingleTask(String jobId, Path workUnitFilePath, Path jobStateFilePath, FileSystem fs,
+      TaskAttemptBuilder taskAttemptBuilder, StateStores stateStores, Config dynamicConfig) {
+    this(jobId, workUnitFilePath, jobStateFilePath, fs, taskAttemptBuilder, stateStores, dynamicConfig, false);
+  }
+
   /**
    * Do all heavy-lifting of initialization in constructor which could be retried if failed,
    * see the example in {@link GobblinHelixTask}.
    */
   SingleTask(String jobId, Path workUnitFilePath, Path jobStateFilePath, FileSystem fs,
-      TaskAttemptBuilder taskAttemptBuilder, StateStores stateStores, Config dynamicConfig) {
+      TaskAttemptBuilder taskAttemptBuilder, StateStores stateStores, Config dynamicConfig, boolean skipGetJobState) {
     _jobId = jobId;
     _workUnitFilePath = workUnitFilePath;
     _jobStateFilePath = jobStateFilePath;
@@ -93,10 +98,14 @@ public class SingleTask {
     _lock = new ReentrantLock();
     _taskAttemptBuilt = _lock.newCondition();
 
-    try {
-      _jobState = getJobState();
-    } catch (IOException ioe) {
-      throw new RuntimeException("Failing in deserializing jobState...", ioe);
+    if (!skipGetJobState) {
+      try {
+        _jobState = getJobState();
+      } catch (IOException ioe) {
+        throw new RuntimeException("Failing in deserializing jobState...", ioe);
+      }
+    } else {
+      this._jobState = null;
     }
   }