500's / Statement Timeout on Merge Request List
Frequently, when using the merge request list to search back by a few pages and then using the sorting (and other filters), a 500 error will be shown. This issue in particular was not caused by the filters or other sorting attributes, but just sorting by "created at"
Link to the same error in Kibana: Internal Only
To reproduce:
- Visit the merge request page and search by something. My search was "merge request filter."
- Sort by created, either asc or desc
Link to the 500 page in this case: https://gitlab.com/gitlab-org/gitlab/-/merge_requests?scope=all&search=merge+request+filter&sort=created_asc&state=opened&utf8=%E2%9C%93
If it does not 500 for you, try sorting in the opposite direction. There is an increase in latency which sometimes times out.
https://sentry.gitlab.net/gitlab/gitlabcom/issues/1817982/?referrer=gitlab_plugin
PG::QueryCanceled: ERROR: canceling statement due to statement timeout
active_record/connection_adapters/postgresql_adapter.rb:675:in `exec_params'
@connection.exec_params(sql, type_casted_binds)
active_record/connection_adapters/postgresql_adapter.rb:675:in `block (2 levels) in exec_no_cache'
@connection.exec_params(sql, type_casted_binds)
active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
yield
active_support/concurrency/share_lock.rb:187:in `yield_shares'
yield
active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
@lock.yield_shares(compatible: [:load]) do
...
(195 additional frame(s) were not displayed)
ActiveRecord::QueryCanceled: PG::QueryCanceled: ERROR: canceling statement due to statement timeout
Edited by Michelle Gill