Automattic / Automattic/kue

Done too quick?

Open
#1,141 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

I have observed the following:

queue.process('SOMENAME', 1, function(job, done) {
done();
//rest of task
});

Basically done is called literally after the job goes active.

The job gets stuck in "active" and thus the task doesn't accept new process'es because it thinks it's still running the job in done() that kue didn't mark as done.

I'm thinking some sort of redis latency (I do have a _few_ keys in the stack).

But wanted to check if I'm doing something wrong or is it a bug?

The job in question appears to complete it's tasks ok, since the `done()` is independent of the task, It's just the `done()` thats tripping up.

I've observed this on other tasks that I have, those I ended up throwing a timer on it, so it doesn't `done()` so quick (5 second count where I call `progress()` whilst it ticks to `done()`'ing).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the queue.process callback behavior with done() called immediately after the job becomes active, then inspect the job lifecycle around that callback and Redis state. Confirm whether the job remains active and blocks new processes; done is complete when the job is marked finished and subsequent work can be accepted.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.