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

Override equality operator for activerecord connection wrapper #269

Merged

Conversation

prburgu
Copy link
Contributor

@prburgu prburgu commented Sep 17, 2020

This will fix proxying == to raw connection.

/var/app/vendor/cache/makara-55759103f219/lib/makara/proxy.rb:137:in `respond_to_missing?'
/var/app/vendor/ruby-2.6.5/lib/ruby/2.6.0/delegate.rb:137:in `respond_to?'
/var/app/vendor/ruby-2.6.5/lib/ruby/2.6.0/delegate.rb:137:in `=='
/var/app/vendor/ruby-2.6.5/lib/ruby/2.6.0/delegate.rb:137:in `=='
/var/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:568:in `delete'

@prburgu prburgu marked this pull request as ready for review September 17, 2020 00:54
@prburgu prburgu requested review from drdrsh and andreasst September 17, 2020 00:54
Copy link
Contributor

@drdrsh drdrsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
I did a quick test to see if any_connection will be called when pool.delete conn is called or not, and your fix works. Thanks for taking care of this.

@prburgu prburgu merged commit ab3dcfb into instacart-main Sep 17, 2020
@prburgu prburgu deleted the prburgu/add-equality-operator-connection-wrappers branch September 17, 2020 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants