Sporadic timeouts from Groups::Security::CredentialsController
Summary
In larger groups, visiting security/credentials (For revoking a token, for example) sometimes results in 500 errors due to long-running statements.
Steps to reproduce
Find large group and visit <instance_url>/-/security/credentials
Example Project
N/A
What is the current bug behavior?
Sporadic 500 errors
What is the expected correct behavior?
Page loads successfully every time
Relevant logs and/or screenshots
Recent correlation ID: 01JP0JVCAHSZJCQ5TRY0JFB70T (Prod/.com)
Output of checks
The statement runs for 15s and is the result of https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/controllers/concerns/credentials_inventory_actions.rb#L55
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Update https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/finders/personal_access_tokens_finder.rb ?
I don't believe the current implementation allows much flexibility for UI data ingestion, maybe we could fetch batches of users first?