We think we've found an inconsistency between how JRuby and MRI handle SIGHUP signals (and others like SIGINT). In MRI any ensure blocks in the method being executed get run but under JRuby this doesn't appear to be the case.
We've attached a test that we think exposes the issue, i.e. the JRuby test fails and the MRI test passes. It works if you have MRI on your PATH as 'ruby' and JRuby on your PATH as 'jruby'. ---- $ ruby -v ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] $ jruby -v jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_13) [x86_64-java] $ ruby test_kill_ensure.rb Loaded suite test_kill_ensure Started F. Finished in 4.007742 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 ---- We've also tried this with the latest version of JRuby from github. At first we thought this might be because the JVM wasn't passing the signal, but if we trap the signal and process it manually it works the same way in MRI and JRuby. Matthew & Abhi
kill_ensure.rb
Description: Binary data
test_kill_ensure.rb
Description: Binary data
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email