Skip to content

Worker doesn't find subsequent jobs? #429

Open
@resting

Description

@resting

For instance, I've queued 10 jobs scheduled 1 minute ahead.

When I trigger the worker with bin/cake queue runworker,
This is the the output:

[2024-12-11 06:39:29] Looking for Job ...
Running Job of type "ApplyAddonsAfterActivation"
Job Finished.
---------------------------------------------------------------
[2024-12-11 06:39:29] Looking for Job ...
nothing to do, exiting.
Performing Old job cleanup.

Only one job was picked up and it exited without finding the next one successfully.

Here's my app_queue.php

return [
  'Queue' => [
    'sleeptime' => 5,
    'workertimeout' => 300, // 5 minutes timeout for worker
    'workermaxruntime' => 300, // 5 minutes runtime for worker
    'maxworkers' => 3,
    'exitwhennothingtodo' => true,
    'cleanuptimeout' => 86400, // remove completed jobs older than 1 day
  ]
];

I'm expecting the worker to pick up the next job after sleeping for 5 sec, and repeat the same process for all the outstanding jobs.

Please correct if my understanding is wrong.

Update:
I tried adding a sleep(3) to my Task, and it starts picking up the subsequent jobs. Not quite sure what's the logic here. Did it complete too fast? Was just logging text output for testing.

On v4.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions