Fix Ctrl+C on salt-run reported as a runner exception - #70181
Open
twangboy wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
SyncClientMixin.low()caughtSystemExitalongsideExceptionto turn a runner module accidentally callingsys.exit()into a nicer error message. This also swallowed theSystemExitraised byscripts.py'sSIGINT/SIGTERMhandler whenCtrl+Cinterrupts 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
SystemExithere so it propagates normally and the CLI exits the way_handle_signalsintended.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