Pausing while active jobs not updating job state
- Dominant language
- JavaScript
- Stars
- 9.4k
- Forks
- 858
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
So pause and resume works in that when I have a queue of jobs and pause them, no other jobs in the queue are processed until I resume, perfect.
The problem is that the jobs that are "active" and successfully complete never get updated to "complete" and stay "active" even after resume.
My job queue processes 10 jobs asynchronously, while they're processing (I'm just using a timeOut for testing) I pause them and resume them and this is then my output.
```
Job #895 got queued of type: communication-sms
Job #896 got queued of type: communication-sms
Job #897 got queued of type: communication-sms
Job #898 got queued of type: communication-sms
Job #899 got queued of type: communication-sms
Job #900 got queued of type: communication-sms
Worker is paused...
Worker is paused...
Worker is paused...
Worker is paused...
Worker is paused...
Worker is paused...
done! 895
done! 896
done! 897
done! 898
done! 899
done! 900
Worker has resumed...
Worker has resumed...
Worker has resumed...
Worker has resumed...
Worker has resumed...
Worker has resumed...
```
After the "done!" output a "Job #x completed!" output is expected in the console but these jobs are not updated to have completed even though they do complete (as seen by "done!").
So I end up having lots of "active" jobs in my queue even though they have completed!
This is surely not intended behaviour? And if it is, then it shouldn't be...
Any help on this issue? Thanks!
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with a queue of 10 asynchronous jobs, pause them during the timeout, and resume them afterward. Trace the pause/resume and job-completion flow, then verify that jobs producing the “done!” output are also marked complete and emit the expected completion message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, redis
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100