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

kue-scheduler does not re-schedule unique job if worker dies uncleanly #82

Open
gmcnaught opened this issue Mar 9, 2017 · 4 comments
Open

Comments

@gmcnaught
Copy link
Collaborator

I believe this is due to a change I introduced:

If a unique job is 'active' and the worker that is processing the job becomes unavailable and never calls done(), and doesn't respond to the ttl timeout, the job will be stuck in 'active', and therefore never gets re-scheduled due to:

https://github.com/lykmapipo/kue-scheduler/blob/master/index.js#L56

    var isCompletedOrFailedJob =
      (job.state() === 'complete' ||
        job.state() === 'failed');

    if (isCompletedOrFailedJob) {

I will submit a pull request to also check if the last_updated value is older than the job ttl and schedule the next job - this way they do not end up stale.

The only reservation I have about this method is that in a situation where the worker is just unable to talk to redis, it may complete the work twice.

@lykmapipo
Copy link
Owner

appreciated

@TangMonk
Copy link

same problem

@bilby91
Copy link

bilby91 commented Aug 15, 2017

I think we are having a similar issue here. After we received a timeout error from redis, the unique scheduled job never triggered again.

@Jageen
Copy link

Jageen commented Jul 3, 2018

I am having same problem and planning to do this

if Job is timeout
Create new job based on the job data.
Delete old job.

Is there any logical error on above flow ?

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

No branches or pull requests

5 participants