Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Raising an exception on a thread that is in a Fiber causes a NullPointerException #1463
Seeing this periodically in an app that uses Fibers and timeout.rb. Timeout is raising exceptions on threads that are in a Fiber, which is crashing the fiber thread.
@headius was able to reproduce it via:
This appears to be fixed now by 0c417d1.
There were two issues.
Both of these issues were fixed by the same modification to resume and yield. When a thread or fiber is waiting on another thread or fiber, exceptions it receives asynchronously need to be forwarded on to the target thread or fiber. Only if the target fiber is dead should the exception be propagated up the call stack as normal.
This issue illustrates more difficult issues with having fibers implemented using threads, but the fix seems to be working well and has so far been confirmed by @cheald. We'll call this fixed, but we should probably prioritize looking into alternative implementations of Fiber for JRuby 9k.