@@ -1151,14 +1151,15 @@ public V await() {
11511151 // At that point, we break the `await()` on the child task.
11521152 // Therefore, once we return from the following `await`,
11531153 // we just need to await again on the *current* child task to obtain the result of this task
1154-
11551154 try {
1156- return this .getChildTask ().await ();
1155+ this .getChildTask ().await ();
11571156 } catch (OrchestratorBlockedException ex ) {
11581157 throw ex ;
1159- } catch (Exception ex ) {
1158+ } catch (Exception ignored ) {
1159+ // ignore the exception from previous child tasks.
1160+ // Only needs to return result from the last child task, which is on next line.
11601161 }
1161-
1162+ // Always return the last child task result.
11621163 return this .getChildTask ().await ();
11631164 }
11641165
@@ -1196,11 +1197,9 @@ private boolean shouldRetryBasedOnPolicy() {
11961197
11971198 // Duration.ZERO is interpreted as no maximum timeout
11981199 Duration retryTimeout = this .policy .getRetryTimeout ();
1199-
12001200 if (retryTimeout .compareTo (Duration .ZERO ) > 0 ) {
12011201 Instant retryExpiration = this .firstAttempt .plus (retryTimeout );
12021202 if (this .context .getCurrentInstant ().compareTo (retryExpiration ) >= 0 ) {
1203-
12041203 // Max retry timeout exceeded
12051204 return false ;
12061205 }
@@ -1381,7 +1380,6 @@ public boolean completeExceptionally(Throwable ex) {
13811380 Task <V > parentTask = this .getParentTask ();
13821381 boolean result = this .future .completeExceptionally (ex );
13831382 if (parentTask instanceof RetriableTask ) {
1384-
13851383 // notify parent task
13861384 ((RetriableTask <V >) parentTask ).handleChildException (ex );
13871385 }
0 commit comments