Skip to content

Commit c628458

Browse files
authored
Updated timeout property documentation (#401)
1 parent 6580cbe commit c628458

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

internal/activity.go

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,33 @@ type (
8181
// optional: The default task queue with the same name as the workflow task queue.
8282
TaskQueue string
8383

84-
// ScheduleToCloseTimeout - The end to end timeout for the activity needed.
84+
// ScheduleToCloseTimeout - Total time that a workflow is willing to wait for Activity to complete.
85+
// ScheduleToCloseTimeout limits the total time of an Activity's execution including retries
86+
// (use StartToCloseTimeout to limit the time of a single attempt).
8587
// The zero value of this uses default value.
86-
// Optional: The default value is the sum of ScheduleToStartTimeout and StartToCloseTimeout
88+
// Either this option or StartToClose is required: Defaults to unlimited.
8789
ScheduleToCloseTimeout time.Duration
8890

89-
// ScheduleToStartTimeout - The maximum time an activity task can stay in a task queue before being picked up by a worker.
90-
// Note that ScheduleToStartTimeout is not retryable as retry would return it back into the same task queue.
91-
// In almost all situations that don't involve routing activities to specific hosts
92-
// it is better to rely on the default value.
93-
// Optional: defaults to unlimited
91+
// ScheduleToStartTimeout - Time that the Activity Task can stay in the Task Queue before it is picked up by
92+
// a Worker. Do not specify this timeout unless using host specific Task Queues for Activity Tasks are being
93+
// used for routing. In almost all situations that don't involve routing activities to specific hosts it is
94+
// better to rely on the default value.
95+
// ScheduleToStartTimeout is always non-retryable. Retrying after this timeout doesn't make sense as it would
96+
// just put the Activity Task back into the same Task Queue.
97+
// If ScheduleToClose is not provided then this timeout is required.
98+
// Optional: Defaults to unlimited.
9499
ScheduleToStartTimeout time.Duration
95100

96-
// StartToCloseTimeout - The timeout from the start of execution to end of it.
97-
// Mandatory: No default.
101+
// StartToCloseTimeout - Maximum time of a single Activity execution attempt.
102+
// Note that the Temporal Server doesn't detect Worker process failures directly. It relies on this timeout
103+
// to detect that an Activity that didn't complete on time. So this timeout should be as short as the longest
104+
// possible execution of the Activity body. Potentially long running Activities must specify HeartbeatTimeout
105+
// and call Activity.RecordHeartbeat(ctx, "my-heartbeat") periodically for timely failure detection.
106+
// If ScheduleToClose is not provided then this timeout is required: Defaults to the ScheduleToCloseTimeout value.
98107
StartToCloseTimeout time.Duration
99108

100-
// HeartbeatTimeout - The periodic timeout while the activity is in execution. This is
101-
// the max interval the server needs to hear at-least one ping from the activity.
102-
// Optional: Default zero, means no heart beating is needed.
109+
// HeartbeatTimeout - Heartbeat interval. Activity must call Activity.RecordHeartbeat(ctx, "my-heartbeat")
110+
// before this interval passes after the last heartbeat or the Activity starts.
103111
HeartbeatTimeout time.Duration
104112

105113
// WaitForCancellation - Whether to wait for canceled activity to be completed(

internal/workflow.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ type (
215215
// Optional: defaults to WorkflowExecutionTimeout
216216
WorkflowRunTimeout time.Duration
217217

218-
// WorkflowTaskTimeout - The workflow task timeout for the child workflow.
219-
// Optional: default is 10s if this is not provided (or if 0 is provided).
218+
// WorkflowTaskTimeout - Maximum execution time of a single Workflow Task. In the majority of cases there is
219+
// no need to change this timeout. Note that this timeout is not related to the overall Workflow duration in
220+
// any way. It defines for how long the Workflow can get blocked in the case of a Workflow Worker crash.
221+
// Default is 10 seconds. Maximum value allowed by the Temporal Server is 1 minute.
220222
WorkflowTaskTimeout time.Duration
221223

222224
// WaitForCancellation - Whether to wait for canceled child workflow to be ended (child workflow can be ended

0 commit comments

Comments
 (0)