Open gacha opened 2 months ago
I wonder if this is a change to how pry-remote or drb works? This will work if you set JRUBY_OPTS=-X+O for both processes as it appears to use _id2ref and that has never worked unless -X+O is enabled (classes/modules actually will work since we do register those even without -X+O).
The pry-remote
has not changed last 7 years. Thanks, for the tip, it works if I use JRUBY_OPTS=-X+O
for both processes. But it worked with previous versions without this option. Is it safe to add this at least in the development, are there some downsides?
@gacha yeah this has to involve how drb is implemented. If you look at https://bugs.ruby-lang.org/issues/15711 we have been trying to deal with this method for a while. I wonder if we used to somehow patch drb somehow?
@headius any thoughts here? Did we deal with referencing objects and patch drb and those patches disappeared?
Oh and to answer your question -X+O has a significant effect on performance as we have to maintain a map to ever ruby object in the runtime. It should be fine for development but you would want to measure perf to see how much it impacts things.
@enebo It looks like the DRb changes I proposed were only partially implemented, and id2ref
is still in use. We can support it with ObjectSpace enabled, but ideally they would use one of the newer mechanisms for weak referencing objects.
We did have a patch in our repository that may never have gotten into DRb proper. I'll see if I can resurrect that.
I have pushed https://github.com/ruby/drb/pull/31 to switch the default ID mapping to the WeakIdConv
that does not use _id2ref
. Both @eregon and I will advocate for getting this merged and released, and once that happens you can update to that version of the drb gem (or to a newer JRuby that includes it) and this will work without full ObjectSpace
support.
Thank you for your work!
A Pry remote session fails using
jruby-9.4.8.0
but works withjruby-9.3.15.0
and older versions. Tested different Java versions, the same result.Environment Information
No
JAVA_OPTS
and noJRUBY_OPTS
.The code
Expected Behavior
Pry-remote connects to the process and we see a prompt.
Actual Behavior
We got an error