[8.19] fix(outlook): retry LDAP user searches with fresh connections (#4441) - #4465
Merged
Merged
Conversation
…4441) Backports #4441 to `8.19`. Related to elastic/sdh-search#1898 ## Summary - Replace the cached LDAP connection with a fresh `Connection` per search. - Add `_ldap_search()` with `@retryable` backoff and `skipped_exceptions=[UsersFetchFailed]`. - Unbind after each search attempt (with defensive cleanup). - Refactor `_fetch_normal_users` / `_fetch_admin_users` to call the shared helper. ## Backport notes - The 8.19 branch still uses the monolithic `connectors/sources/outlook.py` layout (rather than the `outlook/` package split into `client.py`/`datasource.py` on `main`), so the changes were manually adapted to that single module. Behaviour is identical to the original PR. - The incidental `NOTICE.txt` version bump from `make install` is intentionally excluded. ## Test plan - [x] `make clean install autoformat lint test` - [x] `pytest tests/sources/test_outlook.py`
artem-shelkovnikov
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports #4441 to
8.19.Related to https://github.com/elastic/sdh-search/issues/1898
Summary
Connectionper search._ldap_search()with@retryablebackoff andskipped_exceptions=[UsersFetchFailed]._fetch_normal_users/_fetch_admin_usersto call the shared helper.Backport notes
connectors/sources/outlook.pylayout (rather than theoutlook/package split intoclient.py/datasource.pyonmain), so the changes were manually adapted to that single module. Behaviour is identical to the original PR.NOTICE.txtversion bump frommake installis intentionally excluded.Test plan
make clean install autoformat lint testpytest tests/sources/test_outlook.py