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

Job should execute when schedule in the past #460

Open
congphan opened this issue Nov 17, 2018 · 6 comments
Open

Job should execute when schedule in the past #460

congphan opened this issue Nov 17, 2018 · 6 comments

Comments

@congphan
Copy link

I encounter an issue that is when I try to create a job which will be execue at specific time. But some time due to network latency,... then the job is created at time greater than specific time the job should be run. So the schedule is in the past and it can not be executed. Is there any option can make dkron auto execute a job if the schedule put in the past?

Thanks.

@vcastellm
Copy link
Member

Currently there is no such option, some feature could be introduced like the epsilon concept that gives a time window to execute the job it is not executed for some reason but it's not currently implemented.

Anyway, jobs are created quite fast in Dkron, what time difference from the job's time do you use to create jobs? seems that it should be small. Could you post some examples?

@vcastellm
Copy link
Member

Closing for no answer

@congphan
Copy link
Author

congphan commented May 15, 2019 via email

@vcastellm vcastellm reopened this Jun 19, 2019
@yvanoers
Copy link
Collaborator

It seems to me like dkron is being used somewhat like a task queue processor in this scenario.
That could actually be very useful, but it is not the intended use of a task scheduler.
So IMHO there is a risk here of adding a feature that violates the philosophy of doing one thing well.

However, as a suggestion for implementing such a thing, @Victorcoder :
What about an additional schedule keyword:
@after [RFC3339 datetime] <[ISO8601 duration]
For instance, a job with a scheduled like this:
@after 2020-01-01T00:00:00Z <P2H
would run at 2020-01-01 00:00:00 if created before then,
would run immediately if created anywhere between 00:00 and 02:00 on 2020-01-01,
would never run if created after 2020-01-01 02:00:00.

Of course, the first question to answer is whether the use case should be supported at all.

@drauschenbach
Copy link

drauschenbach commented Aug 19, 2020

Currently Dkron does not run jobs if there is no leader at the time when a scheduled job should be kicked off. My team struggles with this on a regular basis, since our private network has a nightly maintenance outage. This issue sounds very related. If a Dkron node becomes a leader, shouldn't it consider kicking off a job that was supposed to be launched a minute ago?

@yvanoers yvanoers changed the title Job should execute when schedue in the past Job should execute when schedule in the past Jun 16, 2021
@vcastellm
Copy link
Member

I can consider implementing something like @yvanoers suggested to fix the use case of missing a job creation using a job queue.

In your case @drauschenbach, it's related but a bit different, do you think that re-triggering jobs with missed executions on becoming leader will cover your use case?

Why "a minute ago"? and not any amount of time?

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

No branches or pull requests

4 participants