Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always check to see if methods exist after calling define_attribute_methods #12632

Merged
merged 1 commit into from
Oct 24, 2013

Conversation

al2o3cr
Copy link
Contributor

@al2o3cr al2o3cr commented Oct 24, 2013

Addresses the bug isolated in #12607 where two threads that both dispatch into method_missing will result in only one of them successfully calling the newly-created method.

No idea how to test this, especially since the bug only appears in a threaded environment under very specific timing conditions.

@rafaelfranca
Copy link
Member

cc @tenderlove

@tenderlove
Copy link
Member

Ah great. Another check-then-act race condition. I should've caught this in b670d79. Thanks!

tenderlove added a commit that referenced this pull request Oct 24, 2013
Always check to see if methods exist after calling define_attribute_methods
@tenderlove tenderlove merged commit 6ae3a4e into rails:master Oct 24, 2013
tenderlove added a commit that referenced this pull request Oct 24, 2013
Always check to see if methods exist after calling define_attribute_methods
@rafaelfranca
Copy link
Member

Great! I cherry-picked some commits related to this on 4-0-stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants