temporalio / temporalio/documentation
Fix contradictory retry behavior in .NET first-program tutorial
Open
@jsundai is already working on this.
Since Aug 6, 2026.
- Dominant language
- JavaScript
- Stars
- 173
- Forks
- 330
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 156
Description
Documentation page
Run your first Temporal application with the .NET SDK
Problem
The “Recover from an unknown error in an Activity” demonstration does not match the retry policy shown earlier on the same page:
var retryPolicy = new RetryPolicy
{
InitialInterval = TimeSpan.FromSeconds(1),
MaximumInterval = TimeSpan.FromSeconds(100),
BackoffCoefficient = 2,
MaximumAttempts = 3,
NonRetryableErrorTypes = new[] { "InvalidAccountException", "InsufficientFundsException" }
};
There are several related inconsistencies:
MaximumAttempts = 3permits three total Activity attempts, including the initial attempt. It does not mean three retries.- The tutorial says the Worker/Workflow “keeps retrying”
DepositAsyncand shows more than three deposit executions. That output is impossible with this retry policy. - After the third failed deposit attempt,
ExecuteActivityAsyncfails and the Workflow enters its refund handling. Therefore, the later instructions to fix the Activity, restart the Worker, and wait for the “next scheduled attempt” cannot work as written. - The page says that code is retried forever unless a
ScheduleToCloseTimeoutorStartToCloseTimeoutis specified.StartToCloseTimeoutlimits each individual attempt; it does not limit the total duration across retries.ScheduleToCloseTimeoutis the overall Activity timeout. - The wording attributes retries to the Worker/Workflow. More precisely, the Temporal Service schedules subsequent Activity Tasks according to the Retry Policy, and a Worker executes those tasks. The Worker process continuing to poll is distinct from an Activity having unlimited retry attempts.
Expected behavior
The prose, sample output, and code should describe the same retry behavior, and the live-debugging exercise should leave a pending retry after the user fixes and restarts the Worker.
Suggested fixes
Either:
- remove
MaximumAttempts = 3(or set it to0) for this live-debugging demonstration so retries remain unlimited; or - rewrite the demonstration to show exactly three attempts followed by the refund path.
Also:
- describe
MaximumAttempts = 3as three total attempts; - remove
StartToCloseTimeoutfrom the statement about limiting the overall retry duration; and - distinguish a Worker continuing to poll from an Activity continuing to retry.
References
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.