Disable query cache when outside Rails executor
What does this MR do and why?
When outside of the Rails executor context, we do not want to enable the query cache because the connection may never get released until the thread terminates.
For example, this happens on console sessions or in long-running threads that do not work in a request context.
How to set up and validate locally
- Enable load balancing in
database.yml
- Test that query cache isn't enabled on the console. You can follow the steps in #328497 (comment 556680988)
- Test that query cache works fine on web requests by checking the performance bar
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #328497 (closed)
Edited by Heinrich Lee Yu