-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Does the job.process function prevent a job from stalling #299
Comments
You will need to implement your operation as non blocking IO, by using fibers or some other asynchronous mechanism (streams maybe), depends on your use case. |
http.get(url, function onResponse(res){
managedUpload = s3.upload({
Body: res,
ACL: 'public-read',
Bucket: 'test-bucket',
Key: domain+'/prod/video/'+entryId+'.'+fileExt
})
managedUpload.on('httpUploadProgress', function(progress){
job.progress(progress.part);
});
managedUpload.send(function(err, data){
if(err){
return done(new Error(err));
}
console.log("Done.");
return done();
});
}); So this is what we're doing. Attempting to pipe videoX from Y to S3
STALLED
Attempting to pipe videoX from Y to S3
Done.
Done. The job completes twice, and the Matador web UI shows the progress fluctuation based on which upload reported progress most recently. |
Thats very weird, I will look more deeply into it. |
@tjsail33 Bull will emit the queue.on('stalled', function (job) {
console.log('Job %s is stalled', job.jobId);
}); |
Note: currently the loop that checks for stalled jobs could actually pick a job for a first process, so this may return false positives. I think a better one is to listen for: queue.on('active', function (job) {
}); That would signal a job that just started processing, if you see multiple |
I will close this issue for now since we are lacking response from the submitter. |
Hey @manast, sorry for the lack of instant response, but I was essentially sleeping for 80% of the time that passed between comments. The answer is that yes, there were multiple active events for the same job. Here's what the output looked like:
It was processing the same job twice simultaneously. |
what I see strange here is that the job got stalled to begin with. It should not happen if the event loop has not been blocked. Any chance you could post the whole process function? also, do you have any other code running on the same node process? Did you also try with the latest version 1.0.0-rc3 ? |
Unfortunately I can't share the rest of the process function due to IP restrictions at work. This was the only job that we had running at the time, and there was nothing else being done by the node process other than process these files. I am not able to try with the latest version, as we were unfortunately forced to rewrite using another library due to time constraints. Sorry this isn't terribly helpful for debugging purposes. If it makes a difference, the calls to |
@tjsail33 I'm assuming that |
@chuym Sorry, was a typo. Corrected it. All parts were correctly reported. |
My question is basically what's in the title. I'm trying to use Bull for a queue to pipe video streams from one source to another, think moving videos from one storage area to another. When these videos grow large, Bull occasionally reports the job as stalled and restarts it, even though the upload is still occurring and I am calling job.process every 10 seconds or so. Is there a way to have job.process act as the "check in" for the job so that it doesnt report as stalled?
The text was updated successfully, but these errors were encountered: