Skip to content

Ctrl+C during flow execution can leave backend step running and mark step as Success #70

Description

@KoEkko

Problem

When ECOS Studio is launched from a terminal, pressing Ctrl+C while a flow step is running can leave the backend/step subprocess alive. The subprocess may continue running after the GUI exits and later update home/flow.json to Success.

After restarting ECOS Studio and loading the same project, the step appears completed. Running the step again also returns immediately because the step state is already Success and the frontend calls run_step with rerun: false.

Confirmed behavior

Closing the app using the top-right close button works correctly: the child process is killed and the running step becomes Incomplete.

The issue appears specific to terminal Ctrl+C / SIGINT handling.

Expected behavior

Pressing Ctrl+C should behave like normal app close:

  • stop the API server and active step subprocesses, or
  • mark the running step as Incomplete / Interrupted,
  • avoid leaving a background task that can later write Success unexpectedly.

Suspected cause

The normal Tauri window close path triggers backend cleanup, but terminal SIGINT may bypass that path. As a result, the API server or step subprocess can outlive the GUI process and continue updating persisted flow state.

Possible fixes

  • Add explicit SIGINT/SIGTERM handling in the Tauri process.
  • Reuse the same cleanup path as normal window close.
  • Ensure active step subprocesses are killed on interrupt.
  • Consider marking in-progress steps as Incomplete or Interrupted during shutdown.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions