@@ -1151,14 +1151,15 @@ public V await() {
1151
1151
// At that point, we break the `await()` on the child task.
1152
1152
// Therefore, once we return from the following `await`,
1153
1153
// we just need to await again on the *current* child task to obtain the result of this task
1154
-
1155
1154
try {
1156
- return this .getChildTask ().await ();
1155
+ this .getChildTask ().await ();
1157
1156
} catch (OrchestratorBlockedException ex ) {
1158
1157
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.
1160
1161
}
1161
-
1162
+ // Always return the last child task result.
1162
1163
return this .getChildTask ().await ();
1163
1164
}
1164
1165
@@ -1196,11 +1197,9 @@ private boolean shouldRetryBasedOnPolicy() {
1196
1197
1197
1198
// Duration.ZERO is interpreted as no maximum timeout
1198
1199
Duration retryTimeout = this .policy .getRetryTimeout ();
1199
-
1200
1200
if (retryTimeout .compareTo (Duration .ZERO ) > 0 ) {
1201
1201
Instant retryExpiration = this .firstAttempt .plus (retryTimeout );
1202
1202
if (this .context .getCurrentInstant ().compareTo (retryExpiration ) >= 0 ) {
1203
-
1204
1203
// Max retry timeout exceeded
1205
1204
return false ;
1206
1205
}
@@ -1381,7 +1380,6 @@ public boolean completeExceptionally(Throwable ex) {
1381
1380
Task <V > parentTask = this .getParentTask ();
1382
1381
boolean result = this .future .completeExceptionally (ex );
1383
1382
if (parentTask instanceof RetriableTask ) {
1384
-
1385
1383
// notify parent task
1386
1384
((RetriableTask <V >) parentTask ).handleChildException (ex );
1387
1385
}
0 commit comments