Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1727] Use default RetryOptions for LocalActivities when not set #2257

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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