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
3.x query cache check accesses connection before app #2142
Comments
|
hey @pritchie ;) You aren't in PDX right now are you? If so, come on over to the hackfest and we can work on this one. |
|
sample app is here. The fix is a 2 liner but let me get some test cases in and then we'll see what the rails core folks have to say |
|
@pritchie Can you please confirm if this issue still exists ?? |
|
Yes, the issue still exists. |
|
Does this happen on 3.2? Or just 3.1? |
|
Not seeing this in 3.2! Thanks! |
|
No, thank you for verifying! :D |
The following code in 3.0.9 causes an error to be raised w/ mysql2 on connect before the controller is loaded.
3.1 has slightly different code but the same issue.
This means you can't rescue any AR connection errors from your controller.
Both are trying to access the AR connection which causes the mysql2 gem to try and connect to the DB. My app has a specific action that attempts to write to the DB but still needs to perform a redirect if the write fails.
It feels like simply setting @query_cache_enabled shouldn't require firing up the connection. I'm willing to work on a patch if someone can point me in the right direction.
The text was updated successfully, but these errors were encountered: