Skip to content

libbeat/processors/translate_ldap_attribute: fix double locking and improve logging#47585

Merged
efd6 merged 3 commits intoelastic:mainfrom
efd6:s6615-ldap_logging
Nov 12, 2025
Merged

libbeat/processors/translate_ldap_attribute: fix double locking and improve logging#47585
efd6 merged 3 commits intoelastic:mainfrom
efd6:s6615-ldap_logging

Conversation

@efd6
Copy link
Contributor

@efd6 efd6 commented Nov 11, 2025

Proposed commit message

libbeat/processors/translate_ldap_attribute: fix double locking and improve logging

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@efd6 efd6 self-assigned this Nov 11, 2025
@efd6 efd6 added enhancement Filebeat Filebeat bugfix Team:Security-Service Integrations Security Service Integrations Team Team:Security-Windows Platform Windows Platform Team in Security Solution backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch backport-9.2 Automated backport to the 9.2 branch labels Nov 11, 2025
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Nov 11, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
…mprove logging

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.
@efd6 efd6 force-pushed the s6615-ldap_logging branch from 9575505 to 4e14399 Compare November 11, 2025 23:51
@efd6 efd6 marked this pull request as ready for review November 12, 2025 01:58
@efd6 efd6 requested a review from a team as a code owner November 12, 2025 01:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@elasticmachine
Copy link
Contributor

Pinging @elastic/sec-windows-platform (Team:Security-Windows Platform)

@efd6 efd6 requested a review from marc-gr November 12, 2025 01:59
@efd6 efd6 requested a review from andrewkroh November 12, 2025 02:53
@efd6
Copy link
Contributor Author

efd6 commented Nov 12, 2025

/test

@efd6 efd6 changed the title libbeat/processors/translate_ldap_attribute: fix double locking and i… Nov 12, 2025
@efd6 efd6 enabled auto-merge (squash) November 12, 2025 09:21
@efd6 efd6 merged commit c2e6257 into elastic:main Nov 12, 2025
252 checks passed
mergify bot pushed a commit that referenced this pull request Nov 12, 2025
…mprove logging (#47585)

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.

(cherry picked from commit c2e6257)
mergify bot pushed a commit that referenced this pull request Nov 12, 2025
…mprove logging (#47585)

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.

(cherry picked from commit c2e6257)

# Conflicts:
#	libbeat/processors/translate_ldap_attribute/translate_ldap_attribute.go
mergify bot pushed a commit that referenced this pull request Nov 12, 2025
…mprove logging (#47585)

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.

(cherry picked from commit c2e6257)
efd6 added a commit that referenced this pull request Nov 12, 2025
…mprove logging (#47585) (#47592)

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.

(cherry picked from commit c2e6257)

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
efd6 added a commit that referenced this pull request Nov 12, 2025
…mprove logging (#47585) (#47590)

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.

(cherry picked from commit c2e6257)

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
efd6 added a commit that referenced this pull request Nov 12, 2025
…ix double locking and improve logging (#47591)

* libbeat/processors/translate_ldap_attribute: fix double locking and improve logging (#47585)

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.

(cherry picked from commit c2e6257)

# Conflicts:
#	libbeat/processors/translate_ldap_attribute/translate_ldap_attribute.go

* resolve conflicts: this does not make use of the passed-in logger

The 9.1 branch does not have the preferred behaviour, but the existing
behaviour is retained to avoid conflating changes.

---------

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
@efd6 efd6 added the backport-9.0 Automated backport to the 9.0 branch label Nov 18, 2025
mergify bot pushed a commit that referenced this pull request Nov 18, 2025
…mprove logging (#47585)

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.

(cherry picked from commit c2e6257)

# Conflicts:
#	libbeat/processors/translate_ldap_attribute/translate_ldap_attribute.go
andrzej-stencel pushed a commit to andrzej-stencel/beats that referenced this pull request Dec 1, 2025
…mprove logging (elastic#47585)

Previously, when findObjectBy was called and the connection was closing,
the reconnect method would both hold the lock and call connect which
attempts to then gain the lock, resulting in a deadlock. Reduce the
level of locking; I believe this can be reduced further, but the
concurrent use protections here are unclear, so I have not gone further.

Also improve debug logging during dial and query.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch backport-9.0 Automated backport to the 9.0 branch backport-9.1 Automated backport to the 9.1 branch backport-9.2 Automated backport to the 9.2 branch bugfix enhancement Filebeat Filebeat Team:Security-Service Integrations Security Service Integrations Team Team:Security-Windows Platform Windows Platform Team in Security Solution

4 participants