Skip to content

fix(vlv): include contextID in subsequent VLV requests - #618

Merged
mistotebe merged 1 commit into
python-ldap:mainfrom
spaceone:fix/control/vlv
Aug 27, 2026
Merged

mistotebe merged 1 commit into
python-ldap:mainfrom
spaceone:fix/control/vlv

Conversation

@spaceone

Copy link
Copy Markdown
Contributor

We wondered about the performance and usage of the whole memory when using the VLV control in a request:

A environment with 200.000 users and 8 GB RAM:

  • normal LDAP search: 6.125s

  • SSS + VLV with PAGE_SIZE=50: aborted after 3-4 minutes, RAM completely full

  • SSS + VLV with PAGE_SIZE=2000: 1m36.634s (slapd Mem 65.7 %)

  • SimplePagedResultsControl PAGE_SIZE=50: 10.394s

  • SimplePagedResultsControl PAGE_SIZE=2000: 6.248s

The VLV request control did not encode the optional contextID field, even when it was present on the request control object.

The LDAP server uses the contextID returned in a VLV response to continue an existing virtual list search. Omitting it causes each subsequent request to be treated as a new VLV search, preventing state reuse and leading to significantly increased processing time and memory usage on the LDAP server.

Encode contextID whenever it is available to allow servers to resume an existing VLV search context as intended by RFC 3876.

The VLV request control did not encode the optional contextID field,
even when it was present on the request control object.

The LDAP server uses the contextID returned in a VLV response to continue an
existing virtual list search. Omitting it causes each subsequent request
to be treated as a new VLV search, preventing state reuse and leading to
significantly increased processing time and memory usage on the LDAP server.

Encode contextID whenever it is available to allow servers to resume an
existing VLV search context as intended by RFC 3876.

Co-Authored-By: Felix Botner <[email protected]>

@mistotebe mistotebe 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.

LGTM

@mistotebe mistotebe added this to the 3.4.8 milestone Aug 25, 2026
@mistotebe
mistotebe merged commit 9909e68 into python-ldap:main Aug 27, 2026
15 of 16 checks passed
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