Skip to content

Worker doesn't find subsequent jobs? #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
resting opened this issue Dec 11, 2024 · 1 comment
Open

Worker doesn't find subsequent jobs? #429

resting opened this issue Dec 11, 2024 · 1 comment
Labels

Comments

@resting
Copy link

resting commented Dec 11, 2024

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

@dereuromark
Copy link
Owner

Did you ever find out what the issue is?
I wonder what the query is when looking it up then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants