Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/src/main/java/io/dapr/durabletask/RetryPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public RetryPolicy setMaxRetryInterval(@Nullable Duration maxRetryInterval) {
* @return this retry policy object
*/
public RetryPolicy setRetryTimeout(Duration retryTimeout) {
if (retryTimeout != null && retryTimeout.compareTo(this.firstRetryInterval) < 0) {
throw new IllegalArgumentException("The value for retryTimeout must be greater than or equal to the value for firstRetryInterval.");
if (retryTimeout == null || retryTimeout.compareTo(this.firstRetryInterval) < 0) {
throw new IllegalArgumentException("The value for retryTimeout cannot be null and must be greater than or equal to the value for firstRetryInterval.");
}
this.retryTimeout = retryTimeout;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1165,10 +1165,14 @@ public V await() {

private boolean shouldRetry() {
if (this.lastFailure.isNonRetriable()) {
return false;
logger.warning("Not performing any retries because the error is non retriable");

return false;
}

if (this.policy != null) {
logger.warning("Performing retires based on policy");

return this.shouldRetryBasedOnPolicy();
} else if (this.handler != null) {
RetryContext retryContext = new RetryContext(
Expand All @@ -1184,6 +1188,8 @@ private boolean shouldRetry() {
}

private boolean shouldRetryBasedOnPolicy() {
logger.warning(this.attemptNumber + " retries out of total %d performed " + this.policy.getMaxNumberOfAttempts());

if (this.attemptNumber >= this.policy.getMaxNumberOfAttempts()) {
// Max number of attempts exceeded
return false;
Expand Down
Loading