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

Fix ActiveRecord :connection incompatibility with serialization libraries #662

Merged
merged 3 commits into from
Dec 20, 2018

Conversation

delner
Copy link
Contributor

@delner delner commented Dec 20, 2018

As of 0.18.0 via #649, we injected the ActiveRecord adapter object as :connection into the sql.active_record, mimicking the behavior of rails/rails#34602 which appears in Rails 6. We did this in order to workaround a performance problem for JRuby, where our previous implementation of id2ref was causing issues.

There are other 3rd party libraries that serialize the output of this sql.active_record event (e.g. meta_request gem), and the :connection object we injected is not serializable, causing a SystemStackError error. It's unclear whether this is a breaking change for Rails 6, such that these libraries should upgrade to be compatible with Rails 6, or just a bug.

Either way, we can't mimic this behavior here for users with Rails < version 6, so we need to implement a new strategy. This pull request instead resolves connections by searching connection pools and finding connection configuration that way, as was originally implemented by @guizmaii.

Addresses #661.

@delner delner self-assigned this Dec 20, 2018
@delner delner requested a review from brettlangdon December 20, 2018 21:45
@delner delner added bug Involves a bug integrations Involves tracing integrations community Was opened by a community member labels Dec 20, 2018
@delner delner added this to the 0.18.1 milestone Dec 20, 2018
@delner delner force-pushed the fix/active_record_event_connection_serialization branch from 95311ef to 601fd80 Compare December 20, 2018 22:31
@delner delner merged commit ce66688 into master Dec 20, 2018
@delner delner deleted the fix/active_record_event_connection_serialization branch December 20, 2018 22:44
@guizmaii
Copy link
Contributor

Sad to see that your previous solution didn't work. It was a better solution. Thanks for your work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants