lucasb has quit [Quit: Connection closed for inactivity]
asp_ has joined #jruby
<asp_> Hello. I have come across a weird issue in JRuby involving Mutexes and ConditionVariables.
<asp_> On MRI this code seems to work fine, but on jruby 9.2.8.0 it works for a bit and then locks up
<headius[m]> Hello
<asp_> Hi
<headius[m]> I don't see anything wrong at a glance. She it is hung, press Ctrl+\ or use jstack command and gist that output
<headius[m]> She it = when it
<asp_> Ok, will do
<asp_> Right, added the Ctrl+\ output as a comment to the gist
<asp_> Actually, I can make the example even more minimal by using only a single conditionvariable
<headius[m]> The threads are both in wait on different locks 🤔
<asp_> OK, well I kinda expected that it was going to be my code that was at fault... would it help if I tested on git master and/or 9.1?
<headius[m]> Yeah worth a try...I'm on mobile at the moment so a bit limited
<headius[m]> Strange
<headius[m]> The impl of wait seems wrong
<headius[m]> It releases the lock and then waits on a semaphore unrelated to the lock, which means signal doesn't do anything
<headius[m]> So main thread rolls right through signal and waits too
<headius[m]> Kinda shocking that this is broken
<headius[m]> Recently broken. Must be a big gap in tests for this
<headius[m]> Try going back a few versions and if you find it works open an issue with your gist
<asp_> ok sure
<asp_> I can confirm the issue is definitely not present in the last 9.1 release
<headius[m]> A spec for spec/ruby/... based on your example would be great too, fine to do as a PR for us
<headius[m]> Looks like I tried to fix interruptibility and broke signalling, but nothing tests this
<headius[m]> Yeah file it for sure then
<headius[m]> Will fix for 9.2.9
<asp_> K, will do
sagax has quit [Read error: Connection reset by peer]
<asp_> Wasn't sure about the title - hope that's all right. I'll have a go at writing a spec.
<headius[m]> Looks good, thanks!
<headius[m]> Should be working in 9.2.7 or .6
<asp_> Yep, it's working in 9.2.7
<headius[m]> 👍
rusk has joined #jruby
dopplergange has quit [Ping timeout: 258 seconds]
whitingjr has joined #jruby
whitingjr has quit [Quit: Leaving.]
shellac has joined #jruby
sagax has joined #jruby
drbobbeaty has joined #jruby
shellac has quit [Quit: Computer has gone to sleep.]
dopplergange has joined #jruby
<rdubya[m]> headius: saw your bug report on Symbol#to_s not returning the same string object (https://bugs.ruby-lang.org/issues/16150), we use that relatively frequently in our app, would it make sense/be possible to add a jruby flag that could be set to have it always return frozen strings (maybe it applies to all "primitives" like you mentioned in the ticket)
<rdubya[m]> Just thought maybe that would be a way to optionally get the functionality in before the full language changes get hammered out
<headius[m]> That's a good idea. We could test everything. I'm still traveling but it might be a trivial PR to submit if you want to try it
<headius[m]> PR doesn't have to make it optional at first and we can see what fails
<headius[m]> Just need another field in RubySymbol to cache the frozen RubyString
<headius[m]> You could try throwing your app at the branch too
<rdubya[m]> Cool, yeah I'll see if I can figure it out
shellac has joined #jruby
<headius[m]> I don't know why someone didn't think of this earlier. All that String allocation
<headius[m]> Credit to schneems for the inspiration
<rdubya[m]> I guess I just assumed that it was already happening lol
<headius[m]> It didn't occur to me until his talk and then is was duh
<headius[m]> We do reuse the same ByteList but it's still a waste of an object
<rdubya[m]> we make pretty extensive use of HashWithIndifferentAccess and its doing this constantly: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/hash_with_indifferent_access.rb#L366
<headius[m]> Yeah that's where schneems found it
<headius[m]> Or something related
<headius[m]> Oh actually it wasn't indifferent so the client code has to always to_s but same deal
<headius[m]> His patch was very localized...this broader change could have a big impact
<headius[m]> Also nil, true, false
<rdubya[m]> I wonder if it would make sense to have a patch on indifferent access that stores a hash of cached strings, would mean a double hash lookup every reference though, so would probably slow things down
<headius[m]> That's essentially what schneems did in another location
<headius[m]> I think it was for respond_to? Against a model...lazily caches the sym to string
<rdubya[m]> cool, yeah could see that getting hot too
jrafanie has joined #jruby
lucasb has joined #jruby
victori has quit [Ping timeout: 245 seconds]
victori has joined #jruby
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
xardion has quit [Remote host closed the connection]
rusk has quit [Remote host closed the connection]
xardion has joined #jruby
shellac has quit [Ping timeout: 250 seconds]
jrafanie has joined #jruby
subbu is now known as subbu|lunch
subbu|lunch is now known as subbu
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
jrafanie has joined #jruby
lucasb has quit [Quit: Connection closed for inactivity]