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
Strange (JIT?) behaviour causing assignment function to be called twice in Rails #937
I'm quite lost on this one - so any help would be appreciated. Essentially I have a Rails model with one of its attribute overridden (say options)
Running this code I'm seeing a strange behaviour that "I'm in options" gets printed TWICE. It happens usually after a cold start (that rails is running but no requests have been made for a while). Once the code is hot it only prints "I'm in options" once.
I haven't logged any of this error in staging yet (where code is preloaded), so it's very likely that this is only impacted by cold start.
Any idea? /cc @headius
referenced this issue
Aug 20, 2013
Looking at this again, I'm pretty sure the fix for #801 will fix this issue as well.
In this case, I think it's possible that the super call looped back on itself via some other alias or wrapper method, but in doing so it got the proper "options=" name on its frame the second time through. As a result, you would see it called twice but then dispatch properly to the superclass.
I'm optimistically marking this as fixed, since it's too similar to #802 to ignore. HOWEVER...if it's at all possible for you to verify your app against JRuby master, it would give me more confidence that it's fixed.