Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: JRuby 1.4
-
Fix Version/s: None
-
Component/s: Interpreter
-
Labels:None
-
Environment:CentOS, OS X 10.5, OS X 10.6
-
Testcase included:yes
Description
JRuby doesn't appear to run 'ensure' code when it receives a kill signal. MRI 1.8.7 on the other hand always runs 'ensure' blocks when it receives a 'kill -HUP' or 'kill -INT'
This means any resources that are cleaned up gracefully via an ensure block don't get cleaned up when the JRuby process is terminated with a 'kill -HUP' or 'kill -QUIT'
We've attached tests for this issue, the MRI test passes but the JRUBY test fails. MRI (ruby) and JRuby (jruby) need to be on the PATH for this test to run.
$ ruby test_kill_ensure.rb -v
Loaded suite test_kill_ensure
Started
test_kill_ensure_with_jruby(TestKillEnsure): F
test_kill_ensure_with_ruby(TestKillEnsure): .
Finished in 2.930825 seconds.
1) Failure:
test_kill_ensure_with_jruby(TestKillEnsure) [test_kill_ensure.rb:12]:
<false> is not true.
2 tests, 2 assertions, 1 failures, 0 errors
Issue Links
- duplicates
-
JRUBY-4637
tearDown() is not executed if the executon is terminated via Control-C
-
In the second sentence, I meant to say 'kill -INT' above not 'kill -QUIT'