-
Notifications
You must be signed in to change notification settings - Fork 867
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
queue events not triggered after worker pause and resume #423
Comments
Queue level events!? or Job level events!? |
queue level events. I am not using job level events as reference to job level events is lost after server restart. For my use case, I store a global reference to |
Oh, the problem could be it. I'm not sure but Kue may want to cleanup if all workers are stopped!! I should check the code and solve it for pause/resume scenarios. I'd like you to write a test case :) |
I'll do that in a few hours and let you know! Thanks :) |
For the test case I have created a fresh repo at https://github.com/aakashlpin/kue-testcase I have not been able to replicate the issue as-is from my existing codebase as the behaviour of kue has changed for this specific test case. However, the issue still exists in one form or the other. I have attached the screenshot of what happens when I run |
try to find what is being changed between your code/setup !?
I should read/run your code, when I have time, but for now I can just say |
Resume is being called as you would see in the logs in console. It even starts processing the next element in the queue but the success callback method done is never called. I am not sure why that would happen as I am not aware of kue internals. So even if I have one single worker, storing the ctx in a global variable is not logical? |
You should call If you have one job type (worker) that would be OK to globally store ctx :) |
Yeah I understand! I am calling done not kue. Silly misunderstanding. I am sure my code is logically correct. Just whenever you have time, it would be great if you can go through the code and see if I am not doing things as it would be expected. Thanks in advance! |
@behrad I have fixed the test case to reflect the initial issue.
(Using |
nice, i should run your code when I have time |
this is definitely a bug in worker#resume which is not updating all flags properly. Thank you @aakashlpin |
Wuhoo! Fantastic. Thank you so much for fixing this 👍 |
@behrad I figured out from the code that you are the author for pause and resume features (So directly addressing this to you.)
I have a use case where I am very tightly dependent on the queue events being received properly. However, even one pause and resume of the queue stops triggering these events. Could you look into it, please?
The text was updated successfully, but these errors were encountered: