Skip to content

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

  1. Enable load balancing in database.yml
  2. Test that query cache isn't enabled on the console. You can follow the steps in #328497 (comment 556680988)
  3. 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.

Related to #328497 (closed)

Edited by Heinrich Lee Yu

Merge request reports