Some native exceptions are wrapped too agressively
--------------------------------------------------

                 Key: JRUBY-6149
                 URL: https://jira.codehaus.org/browse/JRUBY-6149
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.6.4
         Environment: JRuby 1.6.4, 
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
            Reporter: Dave Ray
         Attachments: unrescuable.patch, unrescuable.tgz

Discussed this on twitter with @headius and @technomancy a bit. Clojure's STM 
uses exceptions for retries within a transaction 
(clojure.lang.LockingTransaction$RetryEx). When these exceptions pass through 
JRuby, they're wrapped, causing the STM transaction logic higher up the stack 
to fail since it can't catch the retry exceptions any more.

So, I'm partly just reporting the issue, but I was able to create a fairly 
simple test case (no Clojure or threads) and very naive solution. It's just a 
Set of unrescuable exception types in JavaSupport, extendable by Ruby code. I'm 
sure this is wrong in many ways since I've never looked at the JRuby source 
before, but it was an interesting exercise :)

Example and patch attached.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to