[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: configurable keepalive setting through libldap?

Ralf Haferkamp wrote:
Am Freitag 01 Mai 2009 11:50:15 schrieb masarati@aero.polimi.it:

since quite some time libldap enables tcp-keepalive, e.g. to detected
syncrepl connections. However the default timeout of two hours that most
systems are using might be a bit too long for some applications (e.g. I
had a
problem lately were nscd didn't answer queries anymore because nss_ldap
blocking in SSL_read() while the underlying connection has been cut off).
the other hand messing with the system wide settings might no be a good
either. On Linux it is possible to configure the keepalive settings on a
socket basis through the TCP_KEEP* socket options.

Would it be worth adding ldap_set_option() support for those, even if
they are
not really portable?

I think it would; for archs that do not support it, it could do nothing
(and log accordingly, just in case).

Ok, I'll introduce the following new options for keepalive support then:

We might also think about adding support to set those values for syncrepl and

I'd prefer a portable solution vs something so extremely platform-dependent. As already discussed many times before, we just need a client to send a periodic LDAP no-op message to get the same effect. (Abandon 0 will work fine.) While it's not as general purpose as setting a keepalive in the socket layer, I think we only need to worry about the syncrepl client. back-ldap/meta already have their own retry mechanisms, they can take care of themselves.

So - I'd rather see an option for a periodic LDAP ping added to the syncrepl client - that will work uniformly across all platforms.

And in general - I am opposed to any code that causes our feature set / behavior to differ from platform to platform.

  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/