Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout workflow when WorkflowExecutionTimeout is reached #560

Merged
merged 8 commits into from
Jul 21, 2020

Conversation

alexshtin
Copy link
Member

@alexshtin alexshtin commented Jul 18, 2020

What changed?
If WorkflowExecutionTimeout is reached on workflow, workflow is timed out in spite of cron schedule.
Also fix GetBackoffForNextSchedule to return right result if closeTime is before startTime.

Why?
Fixing bugs discovered in #394.

How did you test it?
Added new unit tests.

Potential risks
No risks.

@@ -58,8 +58,14 @@ func GetBackoffForNextSchedule(cronSchedule string, startTime time.Time, closeTi
if err != nil {
return NoBackoff
}

if closeTime.Before(startTime) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe this is the right fix. If startTime comes after closeTime, then it means some other event triggered invocation of this code path like workflow timeout. In this case we should still try to fire the cron on previous value so we should just return start the delta between startTime and closeTime immediately.

Copy link
Contributor

@samarabbas samarabbas left a comment

Choose a reason for hiding this comment

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

Changes in timerQueueActiveTaskExecutor.go looks good. But you need to slightly adjust the logic in GetBackoffNextSchedule based on the comment I left.

@alexshtin alexshtin merged commit c37db07 into temporalio:master Jul 21, 2020
@alexshtin alexshtin deleted the fix/workflow-timeout branch July 21, 2020 04:04
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