Commit 5afeb8b4 authored by Stan Hu's avatar Stan Hu

Add a Rails backtrace silencer for EE load balancing code

Prior to this change, the SQL backtrace in development.log and test.log
showed `ee/lib/gitlab/database/load_balancing/connection_proxy.rb:63` as
the caller of many queries, which is not helpful in debugging. Filter
these lines out so we don't see them there.

In production, we may want to see these lines in case there is a bug in
the load balancer.
parent dc28f770
Rails.backtrace_cleaner.remove_silencers!
# This allows us to see the proper caller of SQL calls in {development,test}.log
if (Rails.env.development? || Rails.env.test?) && Gitlab.ee?
Rails.backtrace_cleaner.add_silencer { |line| line =~ %r(^ee/lib/gitlab/database/load_balancing) }
end
Rails.backtrace_cleaner.add_silencer { |line| line !~ Gitlab::APP_DIRS_PATTERN }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment