Skip to content

Claimed jobs don't run when queue is cleared #150

@Mortalife

Description

@Mortalife

I have a few hundred items in a queue which has a concurrency of 4.

It seems that upon starting, 4 are immediately ran, and then 3 or so end up as "claimed".

Once those 4 are complete nothing happens, I have to wait for releaseStaleJobsIntervalMin: 1 and releaseStaleJobsMaxClaimedMs: 60_000 to remove the claimed jobs and then retry. This then results in all outstanding jobs being marked as claimed but only 4 get processed. After those 4 have be completed, none of the claimed jobs are ran, I have to wait for the cleanup again.

This doesn't seem right? I would expect that once a queue becomes available that the next job is processed.

On the first iteration I see:

[debug] [2025-12-31 18:38:03] [Sidequest] [Dispatcher] : Queue background limit reached!

However not one subsequent cleanups.

I do see a mass of spam for no available slots.

[debug] [2025-12-31 18:38:00] [Sidequest] [Executor Manager] : Submitting job 597 for execution in queue background
[debug] [2025-12-31 18:38:00] [Sidequest] [Executor Manager] : No available slots for job 597 in queue background
[debug] [2025-12-31 18:38:00] [Sidequest] [JobTransitioner] : Transition SnoozeTransition not applicable for job 597. Returning original job data.
[debug] [2025-12-31 18:38:00] [Sidequest] [Executor Manager] : Submitting job 598 for execution in queue background
[debug] [2025-12-31 18:38:00] [Sidequest] [Executor Manager] : No available slots for job 598 in queue background
[debug] [2025-12-31 18:38:00] [Sidequest] [JobTransitioner] : Transition SnoozeTransition not applicable for job 598. Returning original job data.
[debug] [2025-12-31 18:38:00] [Sidequest] [Executor Manager] : Submitting job 599 for execution in queue background
[debug] [2025-12-31 18:38:00] [Sidequest] [Executor Manager] : No available slots for job 599 in queue background
[debug] [2025-12-31 18:38:00] [Sidequest] [JobTransitioner] : Transition SnoozeTransition not applicable for job 599. Returning original job data.

Seems to me that too many jobs are being claimed, and there's no mechanism notify claimed jobs that they can execute.

I would expect that N jobs be pulled from jobs table whenever there is remaining queue concurrency, and they wouldn't be claimed until that point, since in theory, they could be processed by another runner.

20251231-1858-01.4077712.mp4

This one shows the 4 running, and then nothing.

20251231-1900-05.8843504.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions