Hi guys, I have a question related to the open ldap client keep alive functionality. Our OS is SLES 11. In our client code we are reusing the ldap connections between requests uning a connection pool. For each conenction we are setting the keep-alive options (LDAP_OPT_X_KEEPALIVE_IDLE, LDAP_OPT_X_KEEPALIVE_PROBES and LDAP_OPT_X_KEEPALIVE_INTERVAL) and this works fine. My question is how the openl ldap library (libldap and libldap_r) handles the situation when the number of kee-alive probes for a connection is exceeded and the connection is closed at the server side. Did you dealt with this situation? Thanks, Alin
alin vasile writes:
My question is how the openl ldap library (libldap and libldap_r) handles the situation when the number of kee-alive probes for a connection is exceeded and the connection is closed at the server side.
Sounds like you want ldap_set_rebind_proc(). See man 3 ldap_bind.
The keepalive options are merely TCP options. The server can close connections for other reasons too in any case, such as idletimeout in slapd.conf. Without a rebind proc, the client then receives LDAP_SERVER_DOWN (I think).
alin vasile writes:
My question is how the openl ldap library (libldap and libldap_r) handles the situation when the number of kee-alive probes for a connection is exceeded and the connection is closed at the server side.
Sounds like you want ldap_set_rebind_proc(). See man 3 ldap_bind.
The keepalive options are merely TCP options. The server can close connections for other reasons too in any case, such as idletimeout in slapd.conf. Without a rebind proc, the client then receives LDAP_SERVER_DOWN (I think).
As far as I know, the function registered by ldap_set_rebind_proc(3) is only invoked to bind when chasing a referral.
p.
--- On Wed, 9/8/10, masarati@aero.polimi.it masarati@aero.polimi.it wrote:
As far as I know, the function registered by ldap_set_rebind_proc(3) is only invoked to bind when chasing a referral.
p.
This is what I found until now regarding this function. I'm tracing this in the openldap source code in request.c/ldap_send_server_request :
if ( lc == NULL || lc->lconn_status != LDAP_CONNST_CONNECTED ) { if ( ld->ld_errno == LDAP_SUCCESS ) { ld->ld_errno = LDAP_SERVER_DOWN; }
ber_free( ber, 1 ); if ( incparent ) { /* Forget about the bind */ --parentreq->lr_outrefcnt; }
return( -1 ); }
masarati@aero.polimi.it writes:
As far as I know, the function registered by ldap_set_rebind_proc(3) is only invoked to bind when chasing a referral.
Duh... then what am I talking about - some python-ldap setting?:-)
Hallvard B Furuseth wrote:
masarati@aero.polimi.it writes:
As far as I know, the function registered by ldap_set_rebind_proc(3) is only invoked to bind when chasing a referral.
Duh... then what am I talking about - some python-ldap setting?:-)
This mess with ldap_set_rebind_proc() was removed from python-ldap long ago (December 2002). ;-)
Ciao, Michael.
openldap-technical@openldap.org