-
Notifications
You must be signed in to change notification settings - Fork 446
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
fix(flow): consider to fail a parent not in waiting-children #3098
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Code Review for BullMQ PRWhy is this Change Necessary?In the current implementation of BullMQ, when a child job fails with the How Was This Implemented?To address this issue, the PR introduces a new mechanism to track failed child jobs and fail the parent accordingly. Here's how it was implemented:
Additional Notes
ConclusionThis PR effectively addresses the limitation in BullMQ's failure handling by introducing the |
Are we sure we want to use a plain SET instead of a ZSET for the new unsuccessful state? |
this is something I though in the begining but them in case of inspecting why one of this child failed we should get child record. I though it can be handled similar to get ignored failures where it's also a set that saves these failures to be easily inspected. Something to take in count is that if child is auto removed, failure will still be saved in this set, so a parent. Wdyt? Later I can add a method to retrieve these failures in a paginated way |
after an internal conversation we are trying the approach of using a zset for saving those unsuccessful jobs for now |
Why
How
When a child with failParentOnFailure is true and this child fail. As it's required to pass a job to waiting-children to verify that all children are completed to continue, we can validate if unsuccessful key has a len greater than 0 to move it to failed instead of waiting-children. Take in count that if users do not use moveToWaitingChildren method, parent would fail anyway as not all children will be completed.
Additional Notes (Optional)
Any extra info here.