Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ private void submitAttempt(
slotQueue.submitAttempt(reservationDat, isRetry, task);
}

private RetryOptions getRetryOptions(PollActivityTaskQueueResponseOrBuilder activityTask) {
if (isRetryPolicyNotSet(activityTask)) {
return RetryOptions.getDefaultInstance();
} else {
return RetryOptionsUtils.toRetryOptions(activityTask.getRetryPolicy());
}
}

/**
* @param executionContext execution context of the activity
* @param activityTask activity task
Expand Down Expand Up @@ -154,11 +162,7 @@ private RetryDecision shouldRetry(
throw (Error) attemptThrowable;
}

if (isRetryPolicyNotSet(activityTask)) {
return new RetryDecision(RetryState.RETRY_STATE_RETRY_POLICY_NOT_SET, null);
}

RetryOptions retryOptions = RetryOptionsUtils.toRetryOptions(activityTask.getRetryPolicy());
RetryOptions retryOptions = getRetryOptions(activityTask);

if (RetryOptionsUtils.isNotRetryable(retryOptions, attemptThrowable)) {
return new RetryDecision(RetryState.RETRY_STATE_NON_RETRYABLE_FAILURE, null);
Expand Down Expand Up @@ -368,11 +372,7 @@ private RetryState shouldStillRetry(
@Nullable Failure previousLocalExecutionFailure) {
int currentAttempt = activityTask.getAttempt();

if (isRetryPolicyNotSet(activityTask)) {
return RetryState.RETRY_STATE_RETRY_POLICY_NOT_SET;
}

RetryOptions retryOptions = RetryOptionsUtils.toRetryOptions(activityTask.getRetryPolicy());
RetryOptions retryOptions = getRetryOptions(activityTask);

if (previousLocalExecutionFailure != null
&& previousLocalExecutionFailure.hasApplicationFailureInfo()
Expand Down