Skip to content
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]: ParentJob Not starting when children is already completed #2554

Open
1 task done
leegunwoo98 opened this issue May 3, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@leegunwoo98
Copy link

Version

v5.5.0

Platform

NodeJS

What happened?

Let's say in this structure:
const originalTree = await flow.add({
name: 'root-job',
id :1,
queueName: 'topQueueName',
opts:{ removeOnComplete:true}
data: {},
children: [
{
name,
id :1,
data: { idx: 0, foo: 'bar' },
queueName: 'childrenQueueName',
children: [
{
name,
id :1,
data: { idx: 1, foo: 'bah' },
queueName: 'grandChildrenQueueName',
},
{
name,
id :1,
data: { idx: 2, foo: 'baz' },
queueName: 'grandChildrenQueueName',
},
],
},
{
name,
id :1,
data: { idx: 3, foo: 'foo' },
queueName: 'childrenQueueName',
},
],
});

The root job has the option to removeOnComplete to true. Thus, when everything is finished, the root-job will be deleted and the rest of the Queues still has the completed job of id :1.

Now, if I add the same flow with the same ids, the expected behavior should be that the child queues will not be reprocessed since the jobs are complete, and only the root-job will have processed. However, it seems that the root job will stay in the waiting children state forever. The only way I was able to start the root-job was to delete the direct childrens (either idx:3 or idx: 0) and add the flow again.

The correct behavior should be to start the root-job even when the child jobs are already completed.

How to reproduce.

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@leegunwoo98 leegunwoo98 added the bug Something isn't working label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant