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 = 3 permits three total Activity attempts, including the initial attempt. It does not mean three retries.
- The tutorial says the Worker/Workflow “keeps retrying”
DepositAsync and shows more than three deposit executions. That output is impossible with this retry policy.
- 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.
- 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.
- 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
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:
There are several related inconsistencies:
MaximumAttempts = 3permits three total Activity attempts, including the initial attempt. It does not mean three retries.DepositAsyncand shows more than three deposit executions. That output is impossible with this retry policy.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.ScheduleToCloseTimeoutorStartToCloseTimeoutis specified.StartToCloseTimeoutlimits each individual attempt; it does not limit the total duration across retries.ScheduleToCloseTimeoutis the overall Activity timeout.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:
MaximumAttempts = 3(or set it to0) for this live-debugging demonstration so retries remain unlimited; orAlso:
MaximumAttempts = 3as three total attempts;StartToCloseTimeoutfrom the statement about limiting the overall retry duration; andReferences
RetryPolicy.MaximumAttemptsAPI