dongjoon-hyun opened a new pull request, #58980: URL: https://github.com/apache/spark/pull/58980
### What changes were proposed in this pull request? This PR aims to remove the direct usage of `sun.misc.Signal` from `SparkSQLCLIDriver` so that `SignalUtils` becomes the single place that uses `sun.misc.Signal`. - Add `SignalUtils.withSignalHandler(signal)(handler)(body)`. It installs `handler` for the given signal only while `body` runs, then restores the previous handler. Unlike `SignalUtils.register`, which adds actions to a permanent chain of handlers, it replaces the existing handler for that time. - Update `SparkSQLCLIDriver.processLine` to use the new helper instead of calling `sun.misc.Signal.handle` directly. ### Why are the changes needed? JDK has no public replacement for `sun.misc.Signal`; it remains in the `jdk.unsupported` module as a critical internal API (JEP 260). Keeping all of its usage in one utility class isolates this unsupported API. If JDK adds a public alternative later, only `SignalUtils` will need to change. ### Does this PR introduce _any_ user-facing change? No. The Ctrl+C behavior of the Spark SQL CLI is unchanged: - The first Ctrl+C interrupts the running statement. - A second Ctrl+C exits the JVM. - The previous handler is restored after each line is processed. ### How was this patch tested? Pass the CIs with the existing `CliSuite`. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
