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

stagger deployment crons #781

Open
fatchat opened this issue Jul 31, 2024 · 0 comments
Open

stagger deployment crons #781

fatchat opened this issue Jul 31, 2024 · 0 comments

Comments

@fatchat
Copy link
Contributor

fatchat commented Jul 31, 2024

Problem statement

When clients create scheduled pipelines from the Dalgo UI they provide their preferred time(s) of day when the jobs should run

Right now we turn those into cron expressions and send them to Prefect as part of deployment creation

We therefore can (and do) have multiple deployments on the same schedule, and usually Prefect run only run concurrently as many as there are workers available to run them

Yesterday we had an issue where Prefect attempted to start three scheduled flow-runs despite there being only two workers assigned to that queue, and the CPU spiked and one of the flow-runs crashed

This is probably a Prefect bug... or some misunderstanding on our part of how concurrency works in Prefect

A workaround solution

When a pipeline is created / edited, see if any others are scheduled for the same time. If there are, move the scheduled time of the new / being-edited pipeline up by one minute. Repeat the check until a free slot is found

This will likely be easier to do if the OrgDataFlowv1 stored hour and minute instead of the cron expression

@fatchat fatchat added this to Dalgo Jul 31, 2024
@fatchat fatchat converted this from a draft issue Jul 31, 2024
@fatchat fatchat assigned Ishankoradia and unassigned Ishankoradia Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants