Open bmulholland opened 2 years ago
Alternatively:
require "rjb"
Rjb.load # ADDED
Fiber.new {
Rjb.import("java.lang.String")
}.resume
% RUBYOPT=-w ruby test.rb Exception in thread "main" test.rb:6:in `import': unknown exception (RuntimeError) from test.rb:6:in `block in \<main>'
If it makes a difference in choosing with of the three issues I've filed to look into first, this one is my top priority -- it's blocking me from using GraphQL Dataloader to improve the performance of my app.
Hi bmulholland I could reproduce the crash on x64 box. Therefore it should be fiber and rjb (jvm initialization including class load) combination.
I think it's critical issue between Ruby-Rjb-JVM and I suppose the fix is the long way travel. ~I wonder if you could change your code such as~ (remove 1st exapmle)
In ruby's fiber, any JVM invokation may fail. I think it's caused by fiber and jvm implementation behavior/design. At this time, we can have no chance to use Rjb in fiber.
Thanks for your investigation. We'll look into alternative approaches.
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
test.rb