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

Allow customizing retry behavior for timeout failure #2524

Merged
merged 4 commits into from
Feb 22, 2022

Conversation

yycptt
Copy link
Member

@yycptt yycptt commented Feb 19, 2022

What changed?
Allow customizing retry behavior for timeout errors

  • NOTE: this changes the behavior for both activity and workflow retry policy

Why?
#2496

How did you test it?
Added unit test

Potential risks
This change is technically breaking as the new format defined for timeout failure may matching user defined application error types. But the chance this will happen is very very low.

Is hotfix candidate?
no

@yycptt yycptt requested review from cretz and yiminc February 19, 2022 01:47
@yycptt yycptt requested a review from a team as a code owner February 19, 2022 01:47
@yycptt yycptt changed the title Allow customizing retry behavior for timeout errors Allow customizing retry behavior for timeout failure Feb 19, 2022
Comment on lines 168 to 170
if strings.HasPrefix(nrt, common.TimeoutFailureTypePrefix) {
continue
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

// used in retry policy
// the actual failure type will be prefix + enums.TimeoutType.String()
// e.g. "Temporal Timeout: StartToClose" or "Temporal Timeout: Heartbeat"
TimeoutFailureTypePrefix = "Temporal Timeout: "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should avoid space in the prefix?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Yup, this is a programmatic name not a sentence.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Removed both spaces, and now it becomes TemporalTimeout:

// used in retry policy
// the actual failure type will be prefix + enums.TimeoutType.String()
// e.g. "Temporal Timeout: StartToClose" or "Temporal Timeout: Heartbeat"
TimeoutFailureTypePrefix = "Temporal Timeout: "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Yup, this is a programmatic name not a sentence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants