Skip to content

Removed expiration from RetryPolicy and added one more workflow timeout#35

Merged
mfateev merged 6 commits intotemporalio:masterfrom
mfateev:workflow_timeouts
Apr 29, 2020
Merged

Removed expiration from RetryPolicy and added one more workflow timeout#35
mfateev merged 6 commits intotemporalio:masterfrom
mfateev:workflow_timeouts

Conversation

@mfateev
Copy link
Member

@mfateev mfateev commented Apr 29, 2020

RetryPolicy.expirationIntervalInSeconds specified for how long the retry policy should keep retrying. The problem is that activity already has ScheduleToClose timeout that specifies for how long a workflow is willing to wait for an activity completion. This required extending the ScheduleToClose up to RetryPolicy.expirationInterval by the server which was extremely confusing for users.
For workflows RetryPolicy.expirationIntervalInSeconds limited the duration of retries. At the same time there was no way to limit workflow duration os a cron workflow or a workflow that keeps calling continue as new.

This change:

  1. Removes expirationIntervalInSeconds from RetryPolicy
  2. Renames workflow executionStartToCloseTimeoutSeconds to workflowRunTimeoutSeconds
  3. Adds to workflow workflowExecutionTimeoutSeconds

From now on the server is expected to retry activities up to ScheduleToClose timeout.
The workflow duration is limited to workflowExecutionTimeoutSeconds across all the retries and calls to continue as new. The duration of a single run is limited up to workflowRunTimeoutSeconds.

The other expected server change is that an activity should be given a default retry policy and retried by default unless the retryPolicy. maximumAttempts is not set to 1.

Copy link
Contributor

@alexshtin alexshtin left a comment

Choose a reason for hiding this comment

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

And I have to left your favourite feedback here: dots at the end of comment lines are missed :-)

int32 startToCloseTimeoutSeconds = 9;
// Maximum time between successful worker heartbeats.
int32 heartbeatTimeoutSeconds = 10;
// Retry parameters. Note that activity is retried by default according to a default retry policy.
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
// Retry parameters. Note that activity is retried by default according to a default retry policy.
// Activity retry policy. Note that activity is retried by default according to a default retry policy.

// Maximum time an activity is allowed to execute after a pick up by a worker.
// This timeout is always retriable. Either this or scheduleToCloseTimeoutSeconds is required.
int32 startToCloseTimeoutSeconds = 9;
// Maximum time between successful worker heartbeats.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add required/optional and if optional what is default? The same way as you did for all 3 above.

string firstExecutionRunId = 17;
common.RetryPolicy retryPolicy = 18;
int32 attempt = 19;
int64 workflowExecutionTimeoutTimestamp = 20;
Copy link
Contributor

@alexshtin alexshtin Apr 29, 2020

Choose a reason for hiding this comment

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

Timeout is an interval. TimeoutTimestamp looks weird to me. I believe "expiration" is a better word here. workflowExecutionExpirationTimestamp or even workflowExecutionAbsoluteExpirationTimestamp.

string identity = 9;
string requestId = 10;
common.WorkflowIdReusePolicy workflowIdReusePolicy = 11;
// Retries up to workflowExecutionTimeout
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
// Retries up to workflowExecutionTimeout
// Retries up to workflowExecutionTimeoutSeconds

int32 heartbeatTimeoutSeconds = 16;
// This is an actual retry policy the service uses.
// It can be different from the one provided (or not) during activity scheduling
// as the service can override the provided one with default values.
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually it is vice versa: "provided values override default values". I think better explanation why and when service ignores provided values.

@mfateev mfateev merged commit 33afc28 into temporalio:master Apr 29, 2020
@mfateev mfateev deleted the workflow_timeouts branch April 29, 2020 22:09
mfateev added a commit to temporalio/api-go that referenced this pull request Apr 29, 2020
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