Skip to content

Scheduler: don't skip cron activations #4310

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Michal-Leszczynski
Copy link
Collaborator

Previous behavior for a long run:

Cron activation: |-A-------A-------A------ ...
Task execution:  |-[EEEEEEEE]------[EEE]-- ...

Fixed behavior:

Cron activation: |-A-------A-------A------ ...
Task execution:  |-[EEEEEEEE][EEE]-[EEE]-- ...

Previous behavior for retries:

Cron activation:      |-A-------A-------A----- ...
Task execution/retry: |-[E]-[R]-[R]-----[EE]-- ...

Fixed behavior:

Cron activation:      |-A-------A-------A----- ...
Task execution/retry: |-[E]-[R]-[R][EE]-[EE]-- ...

Fixes #4309

Previous behavior for a long run:
Cron activation: |-A-------A-------A------ ...
Task execution:  |-[EEEEEEEE]------[EEE]-- ...

Fixed behavior:
Cron activation: |-A-------A-------A------ ...
Task execution:  |-[EEEEEEEE][EEE]-[EEE]-- ...

Previous behavior for retries:
Cron activation:      |-A-------A-------A----- ...
Task execution/retry: |-[E]-[R]-[R]-----[EE]-- ...

Fixed behavior:
Cron activation:      |-A-------A-------A----- ...
Task execution/retry: |-[E]-[R]-[R][EE]-[EE]-- ...

Fixes #4309
@Michal-Leszczynski Michal-Leszczynski force-pushed the ml/dont-skip-cron-activations branch from 223bc61 to 11592ea Compare March 25, 2025 10:30
@Michal-Leszczynski Michal-Leszczynski marked this pull request as ready for review March 25, 2025 11:42
@Michal-Leszczynski
Copy link
Collaborator Author

@karol-kokoszka @VAveryanov8 This PR is ready for review!
Please also take minute to consider whether proposed behavior and implementation is sane in general.

@VAveryanov8 VAveryanov8 requested a review from Copilot April 17, 2025 13:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the issue where cron activations were being skipped during long task executions and retries by preserving the initial activation time. Key changes include adjustments to the scheduling logic in the Scheduler, updates to the rescheduling mechanism to use an initial activation timestamp, and corresponding tests to verify the new behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pkg/scheduler/scheduler_test.go Added tests to validate scheduling for long runs, retries, and windows
pkg/scheduler/scheduler.go Modified scheduling/rescheduling logic to use initial activation time
pkg/scheduler/activation.go Added new field and helper for initial activation tracking

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.

Don't skip cron activations
1 participant