[python-ldap] Multiple timeout values in python-ldap, which ones are applicable

varun mittal vmittal05 at gmail.com
Thu Mar 18 04:26:29 EDT 2021

I am using python-ldap==3.1.0 with python3 to query my AD server.

With the following timeout values:

ldap.set_option(ldap.OPT_NETWORK_TIMEOUT, 30)
ldap.set_option(ldap.OPT_TIMEOUT, 120)
conn = ldap.initialize(ldap://server-ip)

Using 3 types of queries - synchronous search_s(), asynchronous with and
without paging search_ext()

I am not using any timeout in the _ext method.

One of my LDAP searches(asynchronous with paging) took about 14 minutes to
complete, in the customer environment. Eventually, the search was

Looking at the documentation, I am not sure which timeout value would be
applicable here.

I thought setting OPT_TIMEOUT should suffice for all kinds of searches.

What am I missing here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/python-ldap/attachments/20210318/130d6559/attachment.html>

More information about the python-ldap mailing list