subbu has joined #jruby
subbu has quit [Ping timeout: 260 seconds]
subbu has joined #jruby
subbu has quit [Ping timeout: 250 seconds]
<kares[m]> <enebo[m]> "kares: I know we are more..." <- honestly do not know - the auto-reconnection in the Java layer felt like legacy and I believe it predates when I started working on AR-JDBC
<kares[m]> think I've seen it in action on an old AR 3.x version or so but it might have been an issue with how the AR pool was managing connections ...
<kares[m]> your PR looks good to me and esp. given this is SQLite it should be fine, I guess (not much SQLite experience though)
<headius> Sorry I am traveling the week before RailsConf but I appreciate everyone's efforts to get Rails 7 working. I will try to fit in work here and there as I can
<headius> woot, working on the bus from Oslo airport to Fredrickstad
<headius> something seems to have broken gems...
<headius> ERROR: Loading command: install (Gem::MissingSpecError)
<headius> ERROR: While executing gem ... (NoMethodError)
<headius> undefined method `deprecated?' for nil:NilClass
<headius> Gem::MissingSpecError
<headius> ugh, or rvm somehow activated and was trying to use CRuby gems with JRuby
<headius> yup false alarm
subbu has joined #jruby
<headius> enebo: I found the problem with that ActiveModel constant, and this could easily explain other constant-scoping weirdness: https://github.com/jruby/jruby/issues/7199
<headius> basically Rails has switched `constantize` to just use `Module#const_get` and our implementation sees toplevel constants when it should not (and probably other edge case issues)
<headius> I tried a quick fix but could not get a combination that would pass all specs
<headius> a re-port of the logic might be in order... it has not been updated in quite a while
subbu has quit [Ping timeout: 256 seconds]
<enebo[m]> headius cool. I am hoping there is nothing too surprising in that methods changes
<enebo[m]> lol
<headius> It really just seems like specific edge cases that we handle badly
<headius> The logic in CRuby is similar but they slice up these cases differently and I could not find a trivial patch
<enebo[m]> seems to be the Ruby 3+ way
<enebo[m]> Things are a bit more complicated than they original appear
<headius> Headed to a family dinner now so probably can't get back to it until tomorrow or Sunday, but fixing all const_get cases may fix all the issues we are seeing with constants
<headius> They use constantize all over
<headius> So much so that a special compile for const_get might be high value
<enebo[m]> headius: I will look this morning. If it is literally just const_get impl then it may not take a long time
<headius> Yeah give it a shot
<enebo[m]> If it also involves other changes to cref and anonymous modules it may be rough
<headius> I could get one or two cases to work but then broke two others
<enebo[m]> Meaning it might be more than one thing for all errors
<headius> Fixing the top level fallback will solve the ActiveModel thing I am pretty certain
<enebo[m]> I am also fresh since I just got up
<headius> Which fixes scaffold post
<enebo[m]> Did you sleep at all on the plane?
<enebo[m]> One other question is whether we are failing something tagged out in const_get
<enebo[m]> fails:Module#const_get raises a NameError when the nested constant does not exist on the module but exists in Object
<enebo[m]> So this must be one behavior
subbu has joined #jruby
<headius> Got a bit of sleep yeah
<headius> Yeah that is the one that triggers the scaffold issue
<enebo[m]> It may also be a 2.6 fail
<headius> Patch that the way I thought and it breaks three others that should not error
<headius> So there's a middle case
subbu has quit [Ping timeout: 248 seconds]
subbu has joined #jruby
<enebo[m]> This does not fix the Time.now errors but it fixes your test case and the only failure within spec:ruby
<headius> Ok that's progress
<headius> Ah I had almost that combination before my bus arrived at the terminal
<headius> What's the code to reproduce the time issue?
<enebo[m]> I have no idea
<enebo[m]> headius: I will try to figure it out (was having lunch)
<enebo[m]> /home/enebo/work/jruby/lib/ruby/gems/shared/gems/minitest-5.15.0/lib/minitest/mock.rb:242: warning: method redefined; discarding old now
<enebo[m]> hnmm
<enebo[m]> At times I wish error messages had a lot more info in them
<enebo[m]> In running subsets of tests this now issue is not appearing so looks like I will slowly narrow into which test causes this
<headius> I think if you log back traces you'll get the extra context because we use the back trace for the warning line
<enebo[m]> headius: that might help
<enebo[m]> At this poitn I think I am slowly getting this down to a single test file which it is starting
<enebo[m]> If I can then this should be a lot easier to enable more verbose errors
<enebo[m]> NameError: Undefined method new for 'Dalli::Client'
<enebo[m]> CacheStoreSettingTest#test_mem_cache_fragment_cache_store_with_multiple_servers:
<enebo[m]> org/jruby/RubyModule.java:3579:in `undef_method'
<enebo[m]> This is interesting though I am seeing an undef on something which has been undef'd
<headius> So far a lot of these rails issues have been them moving to newer features that we just don't have complete yet
<headius> Like moving to const_get
<enebo[m]> yeah it is not too surprising and we don't have too much left to do
<enebo[m]> I guess also we really only need 2.7 semantics to work too
<enebo[m]> Starts with this one: test/cache/stores/file_store_test.rb
<enebo[m]> jruby -w -I"lib" --dev /home/enebo/work/jruby/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/cache/stores/file_store_test.rb"
<enebo[m]> Getting closer
<enebo[m]> There is this time_helpers.rb travel_to which stubs out Time.now and then at end it travel_back which should restore Time
<enebo[m]> I am thinking a) the stubbing is not working b) it is raising in such a way Time is not restored
<enebo[m]> yeah this would make sense it stubs a few objects with aliases and then unstub_all which will basically reset those definitions
<enebo[m]> but since we have some singleton error it probably is unstubbing 0 or not all of them
<enebo[m]> although it looks like it is not stubbing properly to begin with
<headius> Ahh ok that would make sense
<enebo[m]> This must be something with object.singleton_class not doing something
<enebo[m]> Time.singleton_class.alias_method somenewname now
<enebo[m]> jruby -we '3.times do; p Time.object_id; p Time.singleton_class.object_id; p Time.singleton_class.alias_method(:new_now, :now); Time.define_singleton_method(:now) { puts "FFFFFF"; 42 }; p Time.singleton_class.alias_method(:now, :new_now); Time.singleton_class.alias_method :now, :now; p Time.singleton_class.undef_method(:new_now); p ::Time.now; end'
<enebo[m]> bleh...all this stuff is working
<headius> I'm crashing here, will be able to get back to this tomorrow or Sunday
subbu has quit [Ping timeout: 246 seconds]
subbu has joined #jruby
subbu has quit [Ping timeout: 256 seconds]
subbu has joined #jruby
subbu has quit [Ping timeout: 276 seconds]