RFR: 8332921: Ctrl+C does not call shutdown hooks after JLine upgrade

Adam Sotona asotona at openjdk.org
Wed Jun 5 13:42:56 UTC 2024


On Wed, 5 Jun 2024 13:09:01 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> 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.

It look good to me and I can confirm it fixes the test case described in the bug.

-------------

Marked as reviewed by asotona (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19559#pullrequestreview-2099242995


More information about the kulla-dev mailing list