Skip to content

Commit 01717a3

Browse files
committed
Fix things
Signed-off-by: siri-varma <[email protected]>
1 parent 25c524a commit 01717a3

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

client/src/main/java/io/dapr/durabletask/TaskOrchestrationExecutor.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,24 +1151,27 @@ 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+
11541155
try{
1155-
this.getChildTask().await();
1156+
return this.getChildTask().await();
11561157
} catch (OrchestratorBlockedException ex) {
11571158
throw 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.
1159+
} catch (Exception ex) {
11611160
}
1162-
// Always return the last child task result.
1161+
11631162
return this.getChildTask().await();
11641163
}
11651164

11661165
private boolean shouldRetry() {
11671166
if (this.lastFailure.isNonRetriable()) {
1168-
return false;
1167+
logger.warning("Not performing any retries because the error is non retriable");
1168+
1169+
return false;
11691170
}
11701171

11711172
if (this.policy != null) {
1173+
logger.warning("Performing retires based on policy");
1174+
11721175
return this.shouldRetryBasedOnPolicy();
11731176
} else if (this.handler != null) {
11741177
RetryContext retryContext = new RetryContext(
@@ -1184,16 +1187,20 @@ private boolean shouldRetry() {
11841187
}
11851188

11861189
private boolean shouldRetryBasedOnPolicy() {
1190+
logger.warning(this.attemptNumber + " retries out of total %d performed " + this.policy.getMaxNumberOfAttempts());
1191+
11871192
if (this.attemptNumber >= this.policy.getMaxNumberOfAttempts()) {
11881193
// Max number of attempts exceeded
11891194
return false;
11901195
}
11911196

11921197
// Duration.ZERO is interpreted as no maximum timeout
11931198
Duration retryTimeout = this.policy.getRetryTimeout();
1199+
11941200
if (retryTimeout.compareTo(Duration.ZERO) > 0) {
11951201
Instant retryExpiration = this.firstAttempt.plus(retryTimeout);
11961202
if (this.context.getCurrentInstant().compareTo(retryExpiration) >= 0) {
1203+
11971204
// Max retry timeout exceeded
11981205
return false;
11991206
}
@@ -1374,6 +1381,7 @@ public boolean completeExceptionally(Throwable ex) {
13741381
Task<V> parentTask = this.getParentTask();
13751382
boolean result = this.future.completeExceptionally(ex);
13761383
if (parentTask instanceof RetriableTask) {
1384+
13771385
// notify parent task
13781386
((RetriableTask<V>) parentTask).handleChildException(ex);
13791387
}

0 commit comments

Comments
 (0)