Skip to content

[SPARK-55404][PYTHON] Always raise KeyboardInterrupt from SIGINT handler#54187

Open
gaogaotiantian wants to merge 1 commit intoapache:masterfrom
gaogaotiantian:sig-handler-fix
Open

[SPARK-55404][PYTHON] Always raise KeyboardInterrupt from SIGINT handler#54187
gaogaotiantian wants to merge 1 commit intoapache:masterfrom
gaogaotiantian:sig-handler-fix

Conversation

@gaogaotiantian
Copy link
Contributor

What changes were proposed in this pull request?

In SIGINT handler, even if cancelAllJobs() raised an exception, we should keep raising KeyboardInterrupt()

Why are the changes needed?

We should make sure users can Ctrl+C out of the program. self.cancelAllJobs() can raise an exception (for example, self._jsc might be None at that point and it could raise an AttributeError). KeyboardInterrupt() is a BaseException instead of Exception just to make sure it can propagate through a lot of Exception catch check. This makes sure that in most cases our users can send a SIGINT and get out of the program.

Does this PR introduce any user-facing change?

Well yes they can Ctrl+C out now - but it should not be a big deal, more like a bug fix.

How was this patch tested?

CI should pass.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

JIRA Issue Information

=== Bug SPARK-55404 ===
Summary: Always raise KeyboardInterrupt in INT signal handler
Assignee: None
Status: Open
Affected: ["4.2.0"]


This comment was automatically generated by GitHub Actions

@github-actions github-actions bot added the PYTHON label Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant