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

dimas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 476301b9f Propagate previous task exceptions as "suppressed" (#3367)
476301b9f is described below

commit 476301b9f8bc20f07ccb1ac9bbb83f88843920d9
Author: Dmitri Bourlatchkov <[email protected]>
AuthorDate: Tue Jan 6 14:56:49 2026 -0500

    Propagate previous task exceptions as "suppressed" (#3367)
    
    * Propagate previous task exceptions as "suppressed"
    
    Task retries may fail in different ways in each attempt, however
    only the last exception used to be exposed to the caller.
    
    This change propagates exceptions from all previous tasks execution
    attempts as "suppressed" exceptions chained to the final tasks
    failure exception.
---
 .../java/org/apache/polaris/service/task/TaskExecutorImpl.java     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/runtime/service/src/main/java/org/apache/polaris/service/task/TaskExecutorImpl.java
 
b/runtime/service/src/main/java/org/apache/polaris/service/task/TaskExecutorImpl.java
index a30fdac88..bad53cde1 100644
--- 
a/runtime/service/src/main/java/org/apache/polaris/service/task/TaskExecutorImpl.java
+++ 
b/runtime/service/src/main/java/org/apache/polaris/service/task/TaskExecutorImpl.java
@@ -164,10 +164,10 @@ public class TaskExecutorImpl implements TaskExecutor {
       long taskEntityId,
       CallContext callContext,
       PolarisEventMetadata eventMetadata,
-      Throwable e,
+      Throwable previousError,
       int attempt) {
     if (attempt > 3) {
-      return CompletableFuture.failedFuture(e);
+      return CompletableFuture.failedFuture(previousError);
     }
     String realmId = callContext.getRealmContext().getRealmIdentifier();
 
@@ -183,6 +183,9 @@ public class TaskExecutorImpl implements TaskExecutor {
             executor)
         .exceptionallyComposeAsync(
             (t) -> {
+              if (previousError != null) {
+                t.addSuppressed(previousError);
+              }
               LOGGER.warn("Failed to handle task entity id {}", taskEntityId, 
t);
               errorHandler.ifPresent(h -> h.accept(taskEntityId, false, t));
               return tryHandleTask(taskEntityId, callContext, eventMetadata, 
t, attempt + 1);

Reply via email to