Open miridih-jujang opened 2 days ago
hi @miridih-jujang, this is expected as parent job is being moved to failed when children are processed by Workers in 'child' queue, so Worker 'parent' doesn't have a way to get that event as we send 'failed' worker events when this particular instance process an active job. Worker events are being triggered for jobs that are being processed and no for other jobs like parents. For this case you can use our QueueEventsPro class, listening our 'failed' event https://docs.bullmq.io/guide/events https://api.docs.bullmq.io/interfaces/v5.QueueEventsListener.html#failed
Version
Bullmq 5.28.0
Platform
NodeJS v22.8.0
What happened?
When using FlowProducer with child jobs that have the failParent: true option set, if a child job fails, the parent job correctly transitions to a failed state, but the parent job's 'failed' event is not emitted. This creates inconsistency in event handling and monitoring, as we can only catch the child job's failure event but not the parent's.
Project Impact
Our project currently uses BullMQ Pro to implement a complex job processing system. This bug causes several critical issues:
Inability to Track Failures: Cannot accurately track the failure of entire job flows due to missing parent job failure events Critical failure situations may be missed in the monitoring system
Incomplete Error Handling: Unable to automate appropriate follow-up actions for parent job failures Recovery mechanisms for failed jobs may not function properly
Business Logic Impact: Unable to manage the state of entire job groups, affecting interconnected business processes Cannot provide accurate job status updates to users
Reduced System Stability: Accurate detection and handling of failed jobs becomes impossible, reducing system stability Automatic recovery mechanisms in failure scenarios do not work properly
This issue prevents us from achieving our project's core requirements of reliable job processing and monitoring. It's particularly concerning that such a fundamental feature isn't working properly despite using the Pro version, directly impacting our project's overall quality and reliability.
Need for Resolution
Resolving this bug is essential for the successful completion of our project. While workarounds are possible, they increase system complexity and make maintenance more difficult. As Pro version users, we expect this core functionality to work correctly and request a prompt resolution.
How to reproduce.
Relevant log output