Skip to content

Remove rogue exit(0) that shuts down JVM#8438

Merged
headius merged 1 commit intojruby:masterfrom
headius:remove_hard_exit
Nov 20, 2024
Merged

Remove rogue exit(0) that shuts down JVM#8438
headius merged 1 commit intojruby:masterfrom
headius:remove_hard_exit

Conversation

@headius
Copy link
Member

@headius headius commented Nov 20, 2024

For normal JRuby use, we let the main script finish and Main.main exits. If non-daemon threads remain running, they will keep the JVM alive. However a change for CRaC support accidentally introduced a hard exit(0) that is always encountered, even if the script did not request a hard exit using exit or similar Ruby calls.

This patch removes the hard exit(0) so that "casual" exit from the main script does not force the JVM to shut down. The runtime will still be torn down as usual, but non-daemon threads can keep the JVM alive after JRuby itself has exited.

Fixes #8416

For normal JRuby use, we let the main script finish and Main.main
exits. If non-daemon threads remain running, they will keep the
JVM alive. However a change for CRaC support accidentally
introduced a hard exit(0) that is always encountered, even if the
script did not request a hard exit using `exit` or similar Ruby
calls.

This patch removes the hard exit(0) so that "casual" exit from the
main script does not force the JVM to shut down. The runtime will
still be torn down as usual, but non-daemon threads can keep the
JVM alive after JRuby itself has exited.

Fixes jruby#8416
@headius headius added this to the JRuby 9.4.10.0 milestone Nov 20, 2024
@headius headius merged commit 8b022a9 into jruby:master Nov 20, 2024
@headius headius deleted the remove_hard_exit branch November 20, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Possible bug] Can not start jruby-swing applications since 9.4.9.0 - or rather, the window auto-closes almost instantly

1 participant