Issue 8078 - The configured TimeOut in back-meta overlay is not used during the connection phase
Summary: The configured TimeOut in back-meta overlay is not used during the connection...
Status: VERIFIED INVALID
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: backends (show other issues)
Version: 2.4.40
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-12 14:26 UTC by elecharny@openldap.org
Modified: 2021-04-28 15:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description elecharny@openldap.org 2015-03-12 14:26:13 UTC
Full_Name: Emmanuel L.charny
Version: 2.4.40
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (90.46.56.240)


the back-meta overlay meta_back_init_one_conn() method set the timeout to get
the result to a value which is not the one configured (network-timeout AFAIU),
as shown in this portion of the code (line 469 in conn.c) :

        LDAP_BACK_TV_SET( &tv );  

retry:;
        rc = ldap_result( msc->msc_ld, msgid, LDAP_MSG_ALL, &tv, &res );

which uses :

#define	LDAP_BACK_RESULT_TIMEOUT	(0)
#define	LDAP_BACK_RESULT_UTIMEOUT	(100000)
#define	LDAP_BACK_TV_SET(tv) \
	do { \
		(tv)->tv_sec = LDAP_BACK_RESULT_TIMEOUT; \
		(tv)->tv_usec = LDAP_BACK_RESULT_UTIMEOUT; \
	} while ( 0 )

The timeout is then set to 100ms, which might be too low when the remote server
is 'far'.
Comment 1 Quanah Gibson-Mount 2017-04-12 16:41:42 UTC
moved from Incoming to Software Bugs
Comment 2 Nadezhda Ivanova 2021-04-28 14:09:22 UTC
 I don't think this is actually a bug. This is not what network_timeout is meant for. The timeout value for receiving a response is actually the per-operation timeouts, and these are, in fact, honored. ldap_result is called with a tv of LDAP_BACK_RESULT_UTIMEOUT to avoid multiple threads getting stuck waiting for the same connection to become available, but the call is repeated until the configured operation timeout is reached. This is how both back-ldap and back-meta operate, and it is by design.

    network-timeout is provided (by setting LDAP_OPT_NETWORK_TIMEOUT) to ldap_pvt_poll when a new connection is created or an ldap request is sent.