Skip to content

Fix Ctrl+C on salt-run reported as a runner exception - #70181

Open
twangboy wants to merge 1 commit into
saltstack:3008.xfrom
twangboy:fix/70176/3008.x
Open

Fix Ctrl+C on salt-run reported as a runner exception#70181
twangboy wants to merge 1 commit into
saltstack:3008.xfrom
twangboy:fix/70176/3008.x

Conversation

@twangboy

Copy link
Copy Markdown
Contributor

What does this PR do?

SyncClientMixin.low() caught SystemExit alongside Exception to turn a runner module accidentally calling sys.exit() into a nicer error message. This also swallowed the SystemExit raised by scripts.py's SIGINT / SIGTERM handler when Ctrl+C interrupts a blocking runner call (e.g. salt-run state.event), turning a clean, intentional shutdown into a spurious "Exception occurred in runner ..." traceback with the wrong exit code.

Stop catching SystemExit here so it propagates normally and the CLI exits the way _handle_signals intended.

What issues does this PR fix or reference?

Fixes #70176

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

SyncClientMixin.low() caught SystemExit alongside Exception to turn a
runner module accidentally calling sys.exit() into a nicer error
message. This also swallowed the SystemExit raised by scripts.py's
SIGINT/SIGTERM handler when Ctrl+C interrupts a blocking runner call
(e.g. salt-run state.event), turning a clean, intentional shutdown
into a spurious "Exception occurred in runner ..." traceback with
the wrong exit code.

Stop catching SystemExit here so it propagates normally and the CLI
exits the way _handle_signals intended.

Fixes saltstack#70176
@twangboy twangboy added this to the Argon v3008.3 milestone Aug 28, 2026
@twangboy twangboy self-assigned this Aug 28, 2026
@twangboy twangboy added the test:full Run the full test suite label Aug 28, 2026
@twangboy
twangboy requested a review from a team as a code owner August 28, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant