Skip to content

[8.19] fix(outlook): retry LDAP user searches with fresh connections (#4441) - #4465

Merged
Jan-Kazlouski-elastic merged 1 commit into
8.19from
backport/8.19/pr-4441
Sep 9, 2026
Merged

Jan-Kazlouski-elastic merged 1 commit into
8.19from
backport/8.19/pr-4441

Conversation

@Jan-Kazlouski-elastic

Copy link
Copy Markdown
Contributor

Backports #4441 to 8.19.

Related to https://github.com/elastic/sdh-search/issues/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

  • make clean install autoformat lint test
  • pytest tests/sources/test_outlook.py

…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`
@Jan-Kazlouski-elastic
Jan-Kazlouski-elastic merged commit a4b3359 into 8.19 Sep 9, 2026
2 checks passed
@Jan-Kazlouski-elastic
Jan-Kazlouski-elastic deleted the backport/8.19/pr-4441 branch September 9, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants