RFR: 8332921: Ctrl+C does not call shutdown hooks after JLine upgrade
Jan Lahoda
jlahoda at openjdk.org
Wed Jun 5 13:14:24 UTC 2024
Some `Terminal` implementations in JLine reset signal handlers to defaults when `nativeSignals` is set to `true`. Traditionally, this setting was `false` by default, but has been changed for JLine 3.6.0 to `true`:
https://github.com/jline/jline3/pull/971
And recently was brought into the JDK via a JLine upgrade. The consequence is that shutdown handlers are no longer called on Ctrl-C, as the signal handler that runs the shutdown handlers is uninstalled is uninstalled.
This patch proposes to adjust the configuration to set `false` to `nativeSignals` explicitly, on both places where we create new terminals.
I was trying to create a test for this fairly hard, but I didn't find a way to write a test that would reliably fail without the patch and reliably pass with it.
-------------
Commit messages:
- 8332921: Ctrl+C does not call shutdown hooks after JLine upgrade
Changes: https://git.openjdk.org/jdk/pull/19559/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19559&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8332921
Stats: 2 lines in 2 files changed: 1 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/19559.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19559/head:pull/19559
PR: https://git.openjdk.org/jdk/pull/19559
More information about the kulla-dev
mailing list