Skip to content

[autobackport: sssd-2-9] SDAP: reduce logger load in the hot paths#8549

Merged
alexey-tikhonov merged 2 commits into
SSSD:sssd-2-9from
sssd-bot:SSSD-sssd-backport-pr8540-to-sssd-2-9
Mar 25, 2026
Merged

[autobackport: sssd-2-9] SDAP: reduce logger load in the hot paths#8549
alexey-tikhonov merged 2 commits into
SSSD:sssd-2-9from
sssd-bot:SSSD-sssd-backport-pr8540-to-sssd-2-9

Conversation

@sssd-bot

Copy link
Copy Markdown
Contributor

This is an automatic backport of PR#8540 SDAP: reduce logger load in the hot paths to branch sssd-2-9, created by @alexey-tikhonov.

Please make sure this backport is correct.

Note

The commits were cherry-picked without conflicts.

You can push changes to this pull request

git remote add sssd-bot [email protected]:sssd-bot/sssd.git
git fetch sssd-bot refs/heads/SSSD-sssd-backport-pr8540-to-sssd-2-9
git checkout SSSD-sssd-backport-pr8540-to-sssd-2-9
git push sssd-bot SSSD-sssd-backport-pr8540-to-sssd-2-9 --force

Original commits
feca028 - SDAP: reduce logger load in the hot path
87c7bce - SDAP: use DEBUG_CONDITIONAL in the hot paths

Backported commits

  • 7bcc2a3 - SDAP: reduce logger load in the hot path
  • d75db6d - SDAP: use DEBUG_CONDITIONAL in the hot paths

Original Pull Request Body

Logger usage in sdap_get_generic_ext_step() accounts for ~2..3% in the test

time id [email protected] | tr ',' '\n' | wc -l
2802

when ignore_group_members = false and there are 12k users in total.

Other logs changes contribute ~1% in the same test.

@sssd-bot
sssd-bot requested review from ikerexxe and sumit-bose March 25, 2026 10:42
@alexey-tikhonov alexey-tikhonov added no-backport This should go to target branch only. Waiting for review labels Mar 25, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors debug logging by converting DEBUG calls to DEBUG_CONDITIONAL across src/providers/ldap/sdap.c, src/providers/ldap/sdap_async.c, and src/providers/ldap/sdap_range.c. This change aims to improve performance by avoiding function call overhead when debugging is not active. Additionally, logging related to ldap_search_ext in sdap_async.c was consolidated. The review feedback highlights one remaining DEBUG call in sdap_async.c that should also be converted to DEBUG_CONDITIONAL for consistency and further performance optimization.

Comment thread src/providers/ldap/sdap_async.c

@sumit-bose sumit-bose left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

backport matches original version, ACK.

bye,
Sumit

This patch reduced number of *sprintf() keeping the same level
of details in the resulting log.
Besides, list of attrs being requested was excluded from the backtrace.

Reviewed-by: Iker Pedrosa <[email protected]>
Reviewed-by: Sumit Bose <[email protected]>
(cherry picked from commit feca028)
Reviewed-by: Iker Pedrosa <[email protected]>
Reviewed-by: Sumit Bose <[email protected]>
(cherry picked from commit 87c7bce)
@sssd-bot

Copy link
Copy Markdown
Contributor Author

The pull request was accepted by @alexey-tikhonov with the following PR CI status:


🟢 CodeQL (success)
🟢 rpm-build:centos-stream-9-x86_64:upstream (success)
🟢 Build / make-distcheck (success)
🟢 ci / prepare (success)
🟢 ci / system (centos-9) (success)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / pre-commit (success)
🟢 Static code analysis / python-system-tests (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@sssd-bot
sssd-bot force-pushed the SSSD-sssd-backport-pr8540-to-sssd-2-9 branch from d75db6d to 82a4e33 Compare March 25, 2026 14:33
@alexey-tikhonov
alexey-tikhonov merged commit d294a73 into SSSD:sssd-2-9 Mar 25, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accepted no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants