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 #39205 ReadOnlyError when on writing connection #39261

Closed
wants to merge 1 commit into from

Conversation

santib
Copy link
Contributor

@santib santib commented May 13, 2020

Summary

Resolves #39205

I tried to solve the issue by making sure that the variable writing_handler was actually getting set with a writing connection handler (and not a reading one by mistake).

Notes:

  1. I added a test but it looks a bit complex, I couldn't make it be simpler.
  2. I broke the test enlist_fixture_connections ensures multiple databases share a connection pool and couldn't make it work yet. I would appreciate help here.

cc @sinsoku @eileencodes

@eileencodes eileencodes self-assigned this May 13, 2020
@eileencodes
Copy link
Member

Thanks for the fix @santib! I merged your change manually on the command line with a fixed and improved test for the one that was failing.

@eileencodes
Copy link
Member

Merged into master in d4ebba2
Merged into 6-0-stable in 17d5662

Test fix in master in e9d1c9a
Test fix in 6-0-stable in 685584c

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.

ActiveRecord::ReadOnlyError occurs even though it is in the connected_to(role: :writing) block
2 participants