-
Notifications
You must be signed in to change notification settings - Fork 391
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
[Bug]: Delayed jobs are not triggered on time #2648
Comments
Tried to remove the delayed event and re-add it instead of changing the delay and this seems to solve the issue. Then I would draw the conclusion that either something is wrong with My assumption is the following.
|
hi @lindesvard, changeDelay takes current timestamp to apply the new delay. What I'm understanding is that you probably want to reset those 30 minutes instrad of adding 30 minutes to the remaining delay. If my first assumption is right, you only need to do job.changeDelay(1_800_000). |
Oh didn't feel intuitive to use same delay each time. But will give it a try. Thanks for fast reply |
@roggervalf looks like its working. Will close this! |
Maybe a better name would have been "resetDelay" instead of "changeDelay" actually... |
@roggervalf a candidate for deprecation I think. |
Wouldn't this be solve if changeDelay actually got the delay as if it were calculated relative from the job.timestamp? Then |
@lindesvard for me that would be awkward, as you call |
@manast I don't see the problem here but might be missing some deeper understanding. Either way, Thanks for a fantastic library! |
Version
v5.8.7
Platform
NodeJS
What happened?
I have a queue with 2 types (
createEvent
,createSessionEnd
).For each request I get to my api I create a new queue item
event
. This will trigger immediately.Inside the this job I check if a session exists:
create-session-end
(30 minutes)The delayed job is not always triggered on time and can take several hours before it gets triggered (some delayed jobs never gets triggered).
I have no problems with the
createEvent
job at all. It get triggered right away. None of these jobs are heavy. Usually takes 10-100ms to run.edit/addition: Worth to mention, I have also cron jobs running each 10s without any problems or delays.
How to reproduce.
I dont have a reproducing example but I have some questions so I might understand the problem more.
Will the
createEvent
job block the delayed job?I get 10 new jobs a second. Each of these jobs creates a delayed session end job. I would assume that if a createSessionEnd jobs delayed time is over it would have higher priority than the
createEvent
. Is this assumption true?I have tried to throw workers at the queue but it does not look like its taking any delayed job. All workers are just picking
createEvent
jobs even tho I hade 100+ delayed job with its delayed time passed several hours.The delayed time
Is it correct assumption that
job.timestamp + job.delay = The time it should get triggered?
Best way to debug this?
Is there any good way of debugging this? Would love any input or guidance. This might be a related ticket #2466 but update of bullmq didnt seem to help it.
Relevant log output
none for now
Code of Conduct
The text was updated successfully, but these errors were encountered: