lykmapipo / sails-hook-subscriber

Kue based job subscriber(consumer and workers pool) for sails
28 stars 12 forks source link

jobs get stuck in inactive/failed state #2

Closed ghost closed 9 years ago

ghost commented 9 years ago

I have a worker that extracts links from a web page- not sure why but this particular worker (unlike 4 which are working fine) either a) gets stuck in inactive state b) fail one of the things is that this does not always happen which each of the jobs this worker finishes, so that's where the confusion is

Here's the code for the above mentioned worker: http://pastebin.com/xGhPcBt9

What i want to learn is: a) how do i debug what's going wrong b) what can i do to restart the job it fails - would use .attempt(x) be the best option? c) how do i get the jobs to force continue if it gets stuck in inactive mode and nothing is really happening, atm what i have to do is restart the sails server after which the inactive jobs start processing but after some gets done, again the queue gets hanged

thanks :D

lykmapipo commented 9 years ago

@codefullon

Whats the name of file you use to save your job?

ghost commented 9 years ago

hi @lykmapipo , the name of the worker file is 'LinksExtractWorker.js'

and below is the publisher code i use to save the job:

var linksExtractJob = publisher.create('linksextract', { title: "grabbing links from the following url: " + urlPath, url: urlPath, urlId: urlId }).save();

lykmapipo commented 9 years ago

@codefullon

Thanks.

Am on it.

ghost commented 9 years ago

thanks a tonne @lykmapipo - excited to hear the solution :-) cheers

lykmapipo commented 9 years ago

@codefullon

The best way to debug is first to test your workers perform and make sure it pass all it specification.

On other hand,

Hope it helps.

lykmapipo commented 9 years ago

@codefullon

v1.0.0 fix this issue by upgrade to kue v0.9.4 and you have to utilize job ttl