Automattic / Automattic/kue

Resume jobs after stopping jobs causing some errors

Open
#915 7 comments 0 reactions 0 assignees View on GitHub
Question
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

Hi. I followed the documentation to implement "Stop All Jobs" feature:

``` javascript
queue.process('email', function(job, ctx, done){
ctx.pause( 5000, function(err){
console.log("Worker is paused... ");
setTimeout( function(){ ctx.resume(); }, 10000 );
});
});
```

I'm also trying to implement "Start Jobs" - after stopping them, but seems like it causes some error.
The way I start jobs is simply re-creating queue, as follows:

``` javascript
var q = kue.createQueue({
redis: {
port: 1234,
host: '10.0.50.20',
});
```

But as I did this, I can see some errors in the console:
![image](https://cloud.githubusercontent.com/assets/6986883/16517469/22fa4476-3fb0-11e6-91fb-a18156882648.png)
![image](https://cloud.githubusercontent.com/assets/6986883/16517478/2c630d90-3fb0-11e6-8b00-0ea7976a5218.png)

Did I do something wrong here? Am I missing anything?
Please advice.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the documented ctx.pause/ctx.resume flow and the kue.createQueue entry point, then reproduce the stop-and-recreate sequence while capturing the console errors as text. Done means resumed jobs run without the reported errors and the failure is reproducible and explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.