Skip to content

Java exceptions raised in fibers cause the fiber to die without notifying parent #1106

Closed
headius opened this Issue Oct 9, 2013 · 0 comments

1 participant

@headius
JRuby Team member
headius commented Oct 9, 2013

If a Java exception is raised in a fiber body, it will cause the fiber to terminate, leaving any resuming thread hanging on a queue pop that will never be fulfilled. The issue is in the handling of exceptions in the thread logic; Ruby exceptions propagate to the parent but Java exceptions do not, and simply terminate the thread.

This is a local fix I am testing now: https://gist.github.com/6907734

@headius headius added a commit that referenced this issue Oct 9, 2013
@headius headius Propagate all exceptions out of fibers. Fixes #1106.
Only Ruby exceptions were propagating before. This modifies the
thread logic for fibers to also propaate the original Java
exception out in the same way.

This also allows Thread#raise to be called with a Java exception,
which was missing before and needed for this fix.
d607247
@headius headius added a commit that closed this issue Oct 9, 2013
@headius headius Propagate all exceptions out of fibers. Fixes #1106.
Only Ruby exceptions were propagating before. This modifies the
thread logic for fibers to also propaate the original Java
exception out in the same way.

This also allows Thread#raise to be called with a Java exception,
which was missing before and needed for this fix.
82b736b
@headius headius closed this in 82b736b Oct 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.