Sign in or sign up before continuing. Don't have an account yet? Register now to get started.
Register now

Relax the updating of last_used_at of ssh keys when performing fetches.

When a user performs a git-operation through ssh using an SSH key, we update the last_used_at field in the database when gitlab-shell is calling /internal/allowed.

Since that endpoint is called multiple times during the single action (by GitLab-shell and Gitaly), it could end up being called multiple times a second.

I think we should ease this off a bit and move the actual update into sidekiq so the endpoint performs less writes and perhaps can rely only on secondaries.

Additional context

Since ~ Feb 2021, GitLab.com showed "Last used: Never" even when keys are used. In Feb 2022 GitLab.com now shows "Unavailable". This issue will allow GitLab.com to show correct SSH key usage information.

  • FF: Add FF disable setting last_used_at on SSH acce... (!54335 - merged)
  • Bug report: SSH key list shows "Last used: Never", even whe... (#350211 - closed)
Edited Jan 31, 2023 by Nick Malcolm
Assignee Loading
Time tracking Loading