Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Set unack/postpone duration based on task state #3289

Merged
merged 4 commits into from
Oct 13, 2022
Merged

Set unack/postpone duration based on task state #3289

merged 4 commits into from
Oct 13, 2022

Conversation

skorse
Copy link
Contributor

@skorse skorse commented Oct 11, 2022

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes (Please run ./gradlew generateLock saveLock to refresh dependencies)
  • WHOSUSING.md
  • Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR
Set unack/postpone duration based on task state.

Describe the new behavior from this PR, and why it's needed
For workflows with a task in IN_PROGRESS state, the postpone duration is set as (responseTimeoutSeconds + 1). Multiple tasks in IN_PROGRESS state, use the first task. If responseTimeoutSeconds is 0, use a default non-zero value as postpone duration.

For workflows with a task in SCHEDULED state, the postpone duration is set as (pollTimeoutSeconds + 1). If pollTimeoutSeconds is not set, the workflowDef.timeoutSeconds is used for postponeDuration. If the workflowDef.timeoutSeconds is not set, a default non-zero value is used the postpone duration. Multiple tasks in SCHEDULED state, use the first task's value. For deducing the default value, the queue_wait_time metric can be used.

For workflows with a WAIT task in IN_PROGRESS state, the postpone duration is set as the wait timeout seconds computed on the task. If wait timeout is not set, this task is waiting for an external trigger to complete the task. In such cases, the postpone duration will be a default non-zero value.

Alternatives considered

Describe alternative implementation you have considered

@skorse skorse requested review from apanicker-nflx, jxu-nflx and aravindanr and removed request for apanicker-nflx and jxu-nflx October 11, 2022 19:14
@aravindanr
Copy link
Collaborator

Can you add a test for the changes?

@skorse skorse merged commit e2df69d into main Oct 13, 2022
@skorse skorse deleted the tasks/MWI-4643 branch October 13, 2022 20:53
@hebrd
Copy link

hebrd commented Dec 7, 2022

@skorse This feature actually made my workflow stuck for a long time if Response Timeout for including task is long...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants