Skip to content

fix: catch KeyboardInterrupt during startup cleanup - #8

Open
Alicepoltora wants to merge 1 commit into
SeismicSystems:mainfrom
Alicepoltora:fix/startup-interrupt-cleanup
Open

Alicepoltora wants to merge 1 commit into
SeismicSystems:mainfrom
Alicepoltora:fix/startup-interrupt-cleanup

Conversation

@Alicepoltora

Copy link
Copy Markdown

Summary

Fixes #7

Problem

start_node() recorded ownership through on_start_requested and unwound those starts on SupervisorError. But except Exception: does not catch KeyboardInterrupt, so Ctrl+C during startup left already-started programs running.

Fix

Changed except Exception: to except BaseException: so that KeyboardInterrupt also triggers the reverse cleanup of already-started programs before re-raising.

Behavior

  • Ctrl+C during startup now unwinds recorded start requests (stops already-started programs in reverse order)
  • The KeyboardInterrupt is re-raised to preserve exit code 130
  • No changes to ownership boundary: pre-existing programs are not stopped

start_node() unwinds recorded start requests after an ordinary startup
error (SupervisorError), but skipped that cleanup on KeyboardInterrupt.
This left programs started by the interrupted command running after the
CLI reported an interruption.

Changed except Exception to except BaseException so that KeyboardInterrupt
also triggers the reverse cleanup of already-started programs before
re-raising.

Fixes SeismicSystems#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

supervisor: interrupted startup skips cleanup of invocation-started programs

1 participant