Skip to content

Commit

Permalink
Remove rogue exit(0) that shuts down JVM
Browse files Browse the repository at this point in the history
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
  • Loading branch information
headius committed Nov 20, 2024
1 parent c5fb69e commit e39cc98
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ public static void main(String[] args) {
if (status.isExit()) {
System.exit(status.getStatus());
}

System.exit(0);
}
catch (RaiseException ex) {
System.exit( handleRaiseException(ex) );
Expand Down

0 comments on commit e39cc98

Please sign in to comment.