Stop Sync Plan Parent Task When All Child Sub-Tasks Are Stopped

Problem:
Using Katello, I have a daily Sync Plan that executes across all of my Products. Recently, one of the remote repositories has started throwing a warning during sync that a remote rpm is missing and the child sync task for that repo stops with a “warning” status. While this is good to know and I’d like to be notified that there was a problem during synchronization, the problem is that the parent Sync Plan task keeps running indefinitely even though all of its children have stopped. Then the next scheduled Sync Plan doesn’t start because the the previous one is still running.

How do I get the parent Sync Plan to stop once all of its child tasks have stopped (warning or no)?

Expected outcome:
After all child tasks have stopped, the parent Sync Plan task stops as well.

Foreman and Proxy versions and Plugin Versions:
ansible-collection-theforeman-foreman-3.14.0-1.el8.noarch
foreman-3.8.0-1.el8.noarch
foreman-assets-3.8.0-1.el8.noarch
foreman-cli-3.8.0-1.el8.noarch
foreman-debug-3.8.0-1.el8.noarch
foreman-dynflow-sidekiq-3.8.0-1.el8.noarch
foreman-installer-3.8.0-2.el8.noarch
foreman-installer-katello-3.8.0-2.el8.noarch
foreman-obsolete-packages-1.5-1.el8.noarch
foreman-postgresql-3.8.0-1.el8.noarch
foreman-proxy-3.8.0-1.el8.noarch
foreman-selinux-3.8.0-1.el8.noarch
foreman-service-3.8.0-1.el8.noarch
nodejs-theforeman-builder-12.2.0-1.el8.noarch
nodejs-theforeman-vendor-12.0.1-1.el8.noarch
rubygem-foreman_ansible-12.0.7-1.fm3_8.el8.noarch
rubygem-foreman_maintain-1.3.5-1.el8.noarch
rubygem-foreman_remote_execution-11.1.0-1.fm3_8.el8.noarch
rubygem-foreman-tasks-8.2.0-1.fm3_8.el8.noarch
rubygem-foreman_webhooks-3.2.1-1.fm3_8.el8.noarch
rubygem-hammer_cli_foreman-3.8.0-1.el8.noarch
rubygem-hammer_cli_foreman_ansible-0.5.0-1.fm3_7.el8.noarch
rubygem-hammer_cli_foreman_remote_execution-0.2.3-1.fm3_7.el8.noarch
rubygem-hammer_cli_foreman_tasks-0.0.19-1.fm3_7.el8.noarch
rubygem-hammer_cli_foreman_webhooks-0.0.4-1.fm3_5.el8.noarch
foreman-installer-katello-3.8.0-2.el8.noarch
katello-4.10.0-1.el8.noarch
katello-certs-tools-2.9.0-2.el8.noarch
katello-client-bootstrap-1.7.9-2.el8.noarch
katello-common-4.10.0-1.el8.noarch
katello-debug-4.10.0-1.el8.noarch
katello-selinux-5.0.2-1.el8.noarch
rubygem-hammer_cli_katello-1.11.0-0.1.pre.master.20230905173948git1fa5f0c.el8.noarch
rubygem-katello-4.10.0-1.el8.noarch
pulpcore-obsolete-packages-1.0-2.el8.noarch
pulpcore-selinux-1.3.3-1.el8.x86_64
python39-pulp-ansible-0.18.1-1.el8.noarch
python39-pulp-certguard-1.6.5-1.el8.noarch
python39-pulp-cli-0.21.2-1.el8.noarch
python39-pulp-container-2.15.2-1.el8.noarch
python39-pulpcore-3.28.19-1.el8.noarch
python39-pulp-deb-3.0.0-1.el8.noarch
python39-pulp-file-1.14.3-1.el8.noarch
python39-pulp-glue-0.21.2-1.el8.noarch
python39-pulp-python-3.10.0-1.el8.noarch
python39-pulp-rpm-3.22.6-1.el8.noarch
rubygem-pulp_ansible_client-0.18.0-1.el8.noarch
rubygem-pulp_certguard_client-1.6.5-1.el8.noarch
rubygem-pulp_container_client-2.15.2-1.el8.noarch
rubygem-pulpcore_client-3.28.11-1.el8.noarch
rubygem-pulp_deb_client-3.0.0-1.el8.noarch
rubygem-pulp_file_client-1.14.3-1.el8.noarch
rubygem-pulp_ostree_client-2.1.1-1.el8.noarch
rubygem-pulp_python_client-3.10.0-1.el8.noarch
rubygem-pulp_rpm_client-3.22.3-1.el8.noarch
rubygem-smart_proxy_pulp-3.2.0-3.fm3_3.el8.noarch

Distribution and version:
CentOS Stream 8

Other relevant data:

This was already discussed in Sync plan gets stuck in running state if one at least one repo failed

@aruzicka found already the cause: V2::WithSubPlans ignores tasks in stopped-warning · Issue #434 · Dynflow/dynflow · GitHub
But it requires still a fix, so perhaps he can give an update.

There was also Bug #36925: Sync plans in 3.8/4.10 become stuck in running state when any repo fails - Katello - Foreman created for tracking.

It should be fixed in dynflow-1.8.1, packaging PRs are open, it should land in the repos soon-ish.

3 Likes