temporalio / temporalio/documentation

Fix contradictory retry behavior in .NET first-program tutorial

Open
#5,044 0 comments 0 reactions 1 assignee View on GitHub

@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:

  1. MaximumAttempts = 3 permits three total Activity attempts, including the initial attempt. It does not mean three retries.
  2. The tutorial says the Worker/Workflow “keeps retrying” DepositAsync and shows more than three deposit executions. That output is impossible with this retry policy.
  3. After the third failed deposit attempt, ExecuteActivityAsync fails 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.
  4. The page says that code is retried forever unless a ScheduleToCloseTimeout or StartToCloseTimeout is specified. StartToCloseTimeout limits each individual attempt; it does not limit the total duration across retries. ScheduleToCloseTimeout is the overall Activity timeout.
  5. 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 to 0) 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 = 3 as three total attempts;
  • remove StartToCloseTimeout from 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.