Skip to content

PSMDB-2021 Fix dynamic linking of ldap-related libraries#1762

Merged
igorsol merged 1 commit intov8.0from
psmdb-2021-80
Mar 23, 2026
Merged

PSMDB-2021 Fix dynamic linking of ldap-related libraries#1762
igorsol merged 1 commit intov8.0from
psmdb-2021-80

Conversation

@igorsol
Copy link
Copy Markdown

@igorsol igorsol commented Mar 23, 2026

Break cyclic dependency 'ldapmanager' -> 'ldap_options' -> 'ldapmanager by splitting 'ldapmanager' library into 'ldapmanagerbase' and 'ldapmanager' and making 'ldap_options' depend on 'ldapmanagerbase'.
Make 'ldap_options' depend on 'service_context' to fix undefined reference errors.

- split 'ldapmanager' library into 'ldapmanagerbase' and 'ldapmanager'
- make 'ldap_options' depend on 'ldapmanagerbase' and 'service_context'
@igorsol igorsol requested a review from Copilot March 23, 2026 19:22
@github-actions
Copy link
Copy Markdown

Backport Policy Overview

@igorsol, This branch (v8.0) is a production release branch and does not accept direct PRs.
All changes must flow through the corresponding staging branch (v8.0-staging), where they are tested and validated before being promoted into v8.0 by the Server Release team.

Next step: Please re-open this PR against v8.0-staging.

Please reach out in #server-release if you have any questions.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes LDAP-related dynamic linking issues by breaking a cyclic dependency between ldapmanager and ldap_options. It does so by splitting the LDAP manager into a “base” library (core ServiceContext decoration/get/set) and an “impl” library (OpenLDAP-dependent implementation and startup registration), and updating build dependencies accordingly.

Changes:

  • Split LDAP manager into ldap_manager_base (core API/decoration) and ldap_manager (implementation + LDAP syslibs).
  • Move the CreateLDAPManager ServiceContext constructor action from ldap_manager.cpp into ldap_manager_impl.cpp.
  • Update Bazel deps so ldap_options depends on service_context and ldap_manager_base, and remove the legacy SCons build file for this directory.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/mongo/db/ldap/ldap_manager_impl.cpp Hosts LDAP manager creation/registerer and implementation, now owns the constructor action.
src/mongo/db/ldap/ldap_manager.h Adjusts interface (removes create(), makes invalidateConnections() pure virtual) and includes.
src/mongo/db/ldap/ldap_manager.cpp Becomes base-only: ServiceContext decoration + get/set, removing impl construction/registration.
src/mongo/db/ldap/SConscript Removes old SCons library definition for ldapmanager.
src/mongo/db/ldap/BUILD.bazel Introduces ldap_manager_base and redefines ldap_manager as impl-only with LDAP syslibs.
src/mongo/db/BUILD.bazel Updates ldap_options deps to include service_context and ldap_manager_base.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mongo/db/ldap/ldap_manager.h
@igorsol igorsol merged commit 2314b1f into v8.0 Mar 23, 2026
10 checks passed
@igorsol igorsol deleted the psmdb-2021-80 branch March 23, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants