jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-4610

MRI inconsistency: JRuby doesn't appear to run 'ensure' code when it receives a kill signal.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    kill_ensure.rb
    01/Mar/10 1:01 PM
    0.1 kB
    Abhi Hiremagalur
  2. File
    test_kill_ensure.rb
    01/Mar/10 1:01 PM
    0.7 kB
    Abhi Hiremagalur

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. JRUBY-4637 tearDown() is not executed if the executon is terminated via Control-C

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Abhi Hiremagalur added a comment - 02/Mar/10 1:14 PM

In the second sentence, I meant to say 'kill -INT' above not 'kill -QUIT'

Show
Abhi Hiremagalur added a comment - 02/Mar/10 1:14 PM In the second sentence, I meant to say 'kill -INT' above not 'kill -QUIT'
Hide
Permalink
Hiroshi Nakamura added a comment - 06/Jun/11 1:42 AM

JRUBY-4637 is younger than this ticket but there are already some comment and workaround in JRUBY-4637 so I mark this ticket as 'duplicate'. Sorry for that.

Show
Hiroshi Nakamura added a comment - 06/Jun/11 1:42 AM JRUBY-4637 is younger than this ticket but there are already some comment and workaround in JRUBY-4637 so I mark this ticket as 'duplicate'. Sorry for that.

People

  • Assignee:
    Unassigned
    Reporter:
    Abhi Hiremagalur
Vote (0)
Watch (1)

Dates

  • Created:
    01/Mar/10 1:01 PM
    Updated:
    06/Jun/11 1:43 AM
    Resolved:
    06/Jun/11 1:43 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.