Parent job does not execute when child job fails
See original GitHub issueI have a FlowProducer that runs a parent job after a set of children jobs have been executed. There are about 10k children that are being run concurrently. I’ve set the option removeOnFail to true on both the children and the parents but it seems that if a child fail the execution of the parent just hangs.
Could this be a bug or is it a configuration issue on my side?
Here is what the code that create the job looks like:
export const initializeCollectionStats = async () => {
const flowProducer = new FlowProducer({connection: redisClient, sharedConnection: true});
const totalSupply = 10000
const tokenJobs = [];
for (let i = firstTokenID; i <= totalSupply; i++) {
tokenJobs.push({
name: 'child',
data: {
hello: 'world'
},
queueName: "queueName",
opts: {
removeOnFail: true,
attempts: 2,
timeout: 3000
}
})
}
const initJob = await flowProducer.add({
name: 'initProject',
data: {
contractAddress
},
queueName: PROJECT_INIT_QUEUE,
children: tokenJobs,
opts: {
attempts: 1
}
})
return initJob
}
and the worker that run the children job looks like this:
const worker = new Worker(QUEUE_NAME, async (job) => {
const { hello } = job.data
try {
const metadata = await doSomethingAsync(hello)
return "done"
} catch (e) {
logger.error(e)
return null
}
}, { connection: redisClient, concurrency: 300, sharedConnection: true});
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
Parent job is not failing even after Child job failure
We are facing an issue, Parent job is not failing even after failure of child job , Due to this our job flow...
Read more >How to end a parent Job when a child job fails - Stack Overflow
I'm a bit confused. If you run a child job from Spring Batch and the child job fails (BatchStatus = FAILED), the parent...
Read more >Child pipeline job does not wait for parent pipeline ... - GitLab
Job in child pipeline that needs parent pipeline job, does not wait for parent pipeline job to complete before attempting to download artifacts....
Read more >SM37 - BATCH JOBS - Parent job status says FINISHED even ...
This parent job automatically triggers 3 different child jobs under it. The status of the parent job is marked as 'Finished' even when...
Read more >some of parent jobs stuck after their child finish - VOX
Is it occassional issue or always getting stuck and end up cancelling the backups?It might be backup stuck to execute the next child...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is in my pending list, this week I can work on this feature 👀
Currently by design, until all child jobs have been completed the parent job will not be processed.