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

Document next retry delay in .NET #3085

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

cretz
Copy link
Member

@cretz cretz commented Sep 13, 2024

What does this PR do?

Adds the .NET next retry delay, which is the .NET equivalent of the Java version at #2940.

@cretz cretz requested a review from a team as a code owner September 13, 2024 14:34
@@ -125,6 +125,21 @@ return await Workflow.ExecuteActivityAsync(
});
```

### Overriding the retry interval with Next Retry Delay {#next-retry-delay}
Copy link
Contributor

@fairlydurable fairlydurable Sep 17, 2024

Choose a reason for hiding this comment

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

Suggested change
### Overriding the retry interval with Next Retry Delay {#next-retry-delay}
### Override the Retry interval with `NextRetryDelay` {#next-retry-delay}
  • We use infinitive/base form, not present participle.
  • When using specific code-derived terms, such as field names, use code face without spaces.

Copy link
Member Author

@cretz cretz Sep 23, 2024

Choose a reason for hiding this comment

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

This is the form already present/approved at docs/develop/java/failure-detection.mdx and may be a rule worth applying consistently there too instead of just here (but feel free to apply here first)

@@ -125,6 +125,21 @@ return await Workflow.ExecuteActivityAsync(
});
```

### Overriding the retry interval with Next Retry Delay {#next-retry-delay}

You may throw an [Application Failure](/references/failures#application-failure) with the NextRetryDelay field set. This value will replace and override whatever the retry interval would be on the retry policy.
Copy link
Contributor

@fairlydurable fairlydurable Sep 17, 2024

Choose a reason for hiding this comment

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

Suggested change
You may throw an [Application Failure](/references/failures#application-failure) with the NextRetryDelay field set. This value will replace and override whatever the retry interval would be on the retry policy.
When you throw an [Application Failure](/references/failures#application-failure) and assign the `NextRetryDelay` field, its value replaces and overrides the Retry interval defined in the active Retry Policy.
  • Retry and Retry Policy are reserved terms (see Vale list)
  • Consider adding where it was thrown from, "When you throw...from an Activity, and assign the..."
  • What is the active Retry Policy for? An Activity Handle/Stub that called this Activity? Consider adding "in the active Retry Policy for the...."

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the form already present/approved at docs/develop/java/failure-detection.mdx and may be a rule worth applying consistently there too instead of just here (but feel free to apply here first)


You may throw an [Application Failure](/references/failures#application-failure) with the NextRetryDelay field set. This value will replace and override whatever the retry interval would be on the retry policy.

For example, if in an activity, you want to base the interval on the number of attempts, you might do:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For example, if in an activity, you want to base the interval on the number of attempts, you might do:
For example, you might scale the next Retry delay interval based on the current number of attempts.
Here's how you'd do that in an Activity:
  • Activity is a reserved term, so capitalized

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the form already present/approved at docs/develop/java/failure-detection.mdx and may be a rule worth applying consistently there too instead of just here (but feel free to apply here first)

For example, if in an activity, you want to base the interval on the number of attempts, you might do:

```csharp
var attempt = ActivityExecutionContext.Current.Info.Attempt;
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be "obvious" by name and context that this is "retrieve attempt count from the Activity Execution context", but a comment wouldn't hurt, and ditto below, "Update the next Retry delay by assigning a Time value to the nextRetryDelay field"

Also, this uses lower case n for Next. Is the material preceding incorrect?

Copy link
Member Author

@cretz cretz Sep 23, 2024

Choose a reason for hiding this comment

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

but a comment wouldn't hurt, and ditto below

This is the form already present/approved at docs/develop/java/failure-detection.mdx and may be a rule worth applying consistently there too instead of just here (but feel free to apply here first)

Also, this uses lower case n for Next. Is the material preceding incorrect?

Yes

@cretz
Copy link
Member Author

cretz commented Sep 23, 2024

Note, this just copies content from already-approved/published Java and does the slightest alterations for .NET so as not to change what was already approved. Feel free to change what is needed there and here. We made this PR in a branch on the repo itself instead of in a fork so it could be edited by docs before merge.

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.

2 participants