Skip to content

process_launcher waits for its sub-processes when the process is stopped by a StopTask #499

Closed

Description

@njoubert-cleverage

Description

When a process is stopped by a StopTask while process_launcher sub-processes are still running, the process only ends when all of them have finished, instead of stopping them. The documentation ("When the process fails or is stopped (stop request, StopTask) while sub-processes are still running, they are stopped when the task is finalized") and the CHANGELOG of #396 / #459 announce the stop.

4 sub-processes running sleep 30 (command_runner), max_processes: 4:

  • the process fails: the sub-processes are stopped together (warning "4 sub-process(es) still running at the end of the process have been stopped"), 9 s in total;
  • the process is stopped by a StopTask downstream: 32 s, the 4 sub-processes end ("succeed"), no warning.

Cause: the stop is not propagated to the launcher; ProcessManager::resolve() flushes it, and ProcessLauncherTask::next() returns true in flush mode while sub-processes are running: the flush waits for all of them; finalize() is only reached after their natural end. A failure goes round the flush (exception), hence the expected behaviour.

Proposed fix

In ProcessLauncherTask::flush() / next(), when the process has been stopped (ProcessHistory::isStopped()), do not wait: skip the flush, so that finalize() stops the sub-processes together.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: the documented behaviour.

Activity

  1. added a commit that references this issue on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions