Felix Dominguez - 2009-03-04

Not a bug.

OpenLDAP returns "LDAP_SERVER_DOWN" when it can not connect to the LDAP server during an operation.
here is a simple exception handled block that will reconnect to the server after a failed search where the error is LDAP_SERVER_DOWN
again ||= true
begin
var.search2(baseDN, LDAP::LDAP_SCOPE_SUBTREE, filter)
rescue RuntimeError
if ( var.err == LDAP::LDAP_SERVER_DOWN ) && again
var = LDAP::Conn.new(connection_str)
again = false
retry
end
end