You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "adithya2754 (via GitHub)" <gi...@apache.org> on 2026/03/11 07:12:35 UTC

[PR] [GOBBLIN-2255] Temporal workflow fast failure [gobblin]

adithya2754 opened a new pull request, #4174:
URL: https://github.com/apache/gobblin/pull/4174

   Dear Gobblin maintainers,
   
   Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
   
   
   ### JIRA
   - [ ] My PR addresses the following [GOBBLIN-2255]( https://issues.apache.org/jira/browse/GOBBLIN-2255) issues and references them in the PR title.
   
   
   ### Description
   - [ ] Here are some details about my PR, including screenshots (if applicable):
   Temporal workflow goes on to re-attempt even when there is a non intermittent issue - like when user Quota is Exceeded, where successive attempts will not stop it from failure. 
   
   This is to introduce fast failure when we see Quota Exceeded Exceptions during the workflow
   
   ### Tests
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   Tested for a flow
   
   ### Commits
   - [ ] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
       1. Subject is separated from body by a blank line
       2. Subject is limited to 50 characters
       3. Subject does not end with a period
       4. Subject uses the imperative mood ("add", not "adding")
       5. Body wraps at 72 characters
       6. Body explains "what" and "why", not "how"
   
   


-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GOBBLIN-2255] Temporal workflow fast failure [gobblin]

Posted by "adithya2754 (via GitHub)" <gi...@apache.org>.
adithya2754 commented on code in PR #4174:
URL: https://github.com/apache/gobblin/pull/4174#discussion_r2916905317


##########
gobblin-temporal/src/test/java/org/apache/gobblin/temporal/ddm/util/NonRetryableExceptionsTest.java:
##########


Review Comment:
   Although trivial added unit tests for util class :)



-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GOBBLIN-2255] Temporal workflow fast failure [gobblin]

Posted by "adithya2754 (via GitHub)" <gi...@apache.org>.
adithya2754 commented on code in PR #4174:
URL: https://github.com/apache/gobblin/pull/4174#discussion_r2916784687


##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/activity/impl/ProcessWorkUnitImpl.java:
##########
@@ -91,7 +94,16 @@ public int processWorkUnit(WorkUnitClaimCheck wu) {
       troubleshooter = AutomaticTroubleshooterFactory.createForJob(jobState.getProperties());
       troubleshooter.start();
       return execute(workUnits, wu, jobState, fs, troubleshooter.getIssueRepository(), jobState.getProperties());
-    } catch (IOException | InterruptedException e) {
+    } catch (IOException e) {
+      Throwable cause = e.getCause();
+      if (cause instanceof DSQuotaExceededException || cause instanceof NSQuotaExceededException) {

Review Comment:
   yes that would be better ✅



-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GOBBLIN-2255] Temporal workflow fast failure [gobblin]

Posted by "abhishekmjain (via GitHub)" <gi...@apache.org>.
abhishekmjain merged PR #4174:
URL: https://github.com/apache/gobblin/pull/4174


-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GOBBLIN-2255] Temporal workflow fast failure [gobblin]

Posted by "abhishekmjain (via GitHub)" <gi...@apache.org>.
abhishekmjain commented on code in PR #4174:
URL: https://github.com/apache/gobblin/pull/4174#discussion_r2916449389


##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/activity/impl/ProcessWorkUnitImpl.java:
##########
@@ -91,7 +94,16 @@ public int processWorkUnit(WorkUnitClaimCheck wu) {
       troubleshooter = AutomaticTroubleshooterFactory.createForJob(jobState.getProperties());
       troubleshooter.start();
       return execute(workUnits, wu, jobState, fs, troubleshooter.getIssueRepository(), jobState.getProperties());
-    } catch (IOException | InterruptedException e) {
+    } catch (IOException e) {
+      Throwable cause = e.getCause();
+      if (cause instanceof DSQuotaExceededException || cause instanceof NSQuotaExceededException) {

Review Comment:
   can we create a set of non retryable exceptions and check on that instead of writing each exception here?



-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GOBBLIN-2255] Temporal workflow fast failure [gobblin]

Posted by "abhishekmjain (via GitHub)" <gi...@apache.org>.
abhishekmjain commented on code in PR #4174:
URL: https://github.com/apache/gobblin/pull/4174#discussion_r2917066734


##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/util/NonRetryableExceptions.java:
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.gobblin.temporal.ddm.util;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+
+import org.apache.hadoop.hdfs.protocol.DSQuotaExceededException;
+import org.apache.hadoop.hdfs.protocol.NSQuotaExceededException;
+
+import lombok.experimental.UtilityClass;
+
+
+/**
+ * Defines exception types that should trigger immediate, non-retryable application failure
+ * in Temporal workflows. These represent unrecoverable conditions where retrying would be futile.
+ */
+@UtilityClass
+public class NonRetryableExceptions {
+
+  private static final Set<Class<? extends Exception>> EXCEPTIONS;
+  static {
+    Set<Class<? extends Exception>> exceptions = new HashSet<>();
+    exceptions.add(NSQuotaExceededException.class);
+    exceptions.add(DSQuotaExceededException.class);
+    EXCEPTIONS = Collections.unmodifiableSet(exceptions);
+  }
+
+  /**
+   * Checks whether the given throwable matches a known non-retryable exception type.
+   * @return an {@link Optional} containing the matched throwable if it is non-retryable, empty otherwise.
+   */
+  public static Optional<Throwable> matchNonRetryable(Throwable throwable) {
+    if (throwable == null) {
+      return Optional.empty();
+    }
+    for (Class<? extends Exception> exClass : EXCEPTIONS) {
+      if (exClass.isInstance(throwable)) {

Review Comment:
   we should also check for cause recursively, throwable has `getClause()` which returns null when there is no more underlying cause.
   
   ```  
   public synchronized Throwable getCause() {
       return (cause==this ? null : cause);
   }
   ```



-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GOBBLIN-2255] Temporal workflow fast failure [gobblin]

Posted by "abhishekmjain (via GitHub)" <gi...@apache.org>.
abhishekmjain commented on code in PR #4174:
URL: https://github.com/apache/gobblin/pull/4174#discussion_r2917071204


##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/util/NonRetryableExceptions.java:
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.gobblin.temporal.ddm.util;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+
+import org.apache.hadoop.hdfs.protocol.DSQuotaExceededException;
+import org.apache.hadoop.hdfs.protocol.NSQuotaExceededException;
+
+import lombok.experimental.UtilityClass;
+
+
+/**
+ * Defines exception types that should trigger immediate, non-retryable application failure
+ * in Temporal workflows. These represent unrecoverable conditions where retrying would be futile.
+ */
+@UtilityClass
+public class NonRetryableExceptions {
+
+  private static final Set<Class<? extends Exception>> EXCEPTIONS;
+  static {
+    Set<Class<? extends Exception>> exceptions = new HashSet<>();
+    exceptions.add(NSQuotaExceededException.class);
+    exceptions.add(DSQuotaExceededException.class);
+    EXCEPTIONS = Collections.unmodifiableSet(exceptions);
+  }
+
+  /**
+   * Checks whether the given throwable matches a known non-retryable exception type.
+   * @return an {@link Optional} containing the matched throwable if it is non-retryable, empty otherwise.
+   */
+  public static Optional<Throwable> matchNonRetryable(Throwable throwable) {
+    if (throwable == null) {
+      return Optional.empty();
+    }
+    for (Class<? extends Exception> exClass : EXCEPTIONS) {
+      if (exClass.isInstance(throwable)) {

Review Comment:
   this will help in identifying cases where the nonRetryableException is nested



-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org