Skip to content

Perform LDAP group sync on sign in only for new users

What does this MR do?

Changes the LDAP Group Sync on sign in so it is only executed for new users. Other than reducing number of sync jobs in Sidekiq, customers should not notice the change because other sync mechanisms will ensure user's group membership always stays up to date. We have the hourly (by default) group sync which will ensure all groups are updated and group owners can trigger an on-demand sync at any time. The primary reason this feature was introduced in the first place was so new users didn't have to wait until the top of the next hour to get access to their groups/projects. See https://gitlab.com/gitlab-org/gitlab-ee/issues/906 where this was originally discussed and solved. In this regard this change does not modify the intention.

The specific problem we saw with customers is that they're getting way too many LdapGroupSyncWorkers piling up in Sidekiq. The syncs in question are triggered from EE::Gitlab::Auth::LDAP::Access#update_memberships. Note that the worker isn't triggered on absolutely every git push via SSH. It's only once every LDAP sync_time (default of 1 hour).

What are the relevant issue numbers?

#7352 (closed)

Does this MR meet the acceptance criteria?

Closes #7352 (closed)

Edited by Drew Blessing

Merge request reports