Skip to content

Conversation

@rajeshwar-nu
Copy link

@rajeshwar-nu rajeshwar-nu commented Jan 8, 2026

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • WHOSUSING.md
  • Other (please describe):

Summary

  • Use the minimum eligible unack delay across tasks rather than the first match.
  • Cap scheduled-task delays using maxPostponeDurationSeconds, consistent with in-progress tasks.
  • Add tests for multi-task minimum selection and scheduled cap.
  • Clarify maxPostponeDurationSeconds behavior in config docs.

Motivation / Context

Workflows can have multiple active tasks (e.g., forks). The previous unack logic stopped at the first IN_PROGRESS/SCHEDULED task and did not cap scheduled delays, which could postpone decider evaluation longer than necessary or beyond the configured max. This change ensures the decider is requeued at the earliest
applicable timeout while honoring maxPostponeDurationSeconds.

Changes in this PR

  • WorkflowSweeper now computes candidate delays for all eligible tasks, caps each by maxPostponeDurationSeconds, and selects the minimum.
    • Added tests to cover:
      • minimum selection across IN_PROGRESS + SCHEDULED tasks
      • maxPostponeDurationSeconds capping for scheduled tasks
    • Updated configuration documentation to reflect the cap applies to both IN_PROGRESS and SCHEDULED candidates before selecting the minimum.

@rajeshwar-nu rajeshwar-nu changed the title Improve decider unack logic Fix WorkflowSweeper unack delay selection and cap scheduled postpones Jan 8, 2026
@rajeshwar-nu rajeshwar-nu marked this pull request as ready for review January 8, 2026 08:59
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.

1 participant