Skip to content

Retry if got empty ldap results for certain response code

What does this MR do?

This MR will do some retries in LDAP search execution if the returned data is empty and with specified response code in LDAP configuration. The implementation it self inspired by Hashicorp's go-retryablehttp.

The background for this implementation, our Gitlab EE in GCP is configured using LDAP sync for users and groups to Google Secure LDAP, but since we have a lot number of users and groups to be synced then it will generating burst of queries that sometime returning empty response by status code 80. We already raise the ticket to Google Workspace Support that confirmed for it's behavior/design.

But the impact in our Gitlab is quite fatal because it will block the user (for ldap user sync) and will clean up all member in a group (for ldap group sync) which can (may) be fixed in next configured sync interval until then users which got this experience will complaining due cannot access Gitlab or some features related to Grouping such as approval, CODEOWNER, etc cannot be used.

So then by retrying it until MAX_SEARCH_RETRIES will prevent the issue happen. Actually the implementation was there for any network connection error but not for empty ldap query results.

Screenshots (strongly suggested)

Got empty result in LDAP group sync that caused emptying group's member. kibana_empty_gitlab_group_members_query_fl

Some errors once the users massively got blocked in LDAP user sync ldap_search_error_empty_result_fl

User got blocked when got empty results user_got_blocked_fl

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Omar Mochtar

Merge request reports