Univention Bugzilla – Bug 34292
uldap.py: Try again when the LDAP server is not reachable
Last modified: 2014-09-09 20:20:27 CEST
Since UCS 3.2 the LDAP server is restarted in more and more cases. For example during the schema registration. This leads to a lot of "Can't contact LDAP server" messages and sometimes to aborts for example during the join.
With Bug #32617 we switched to LDAPReconnectObject which reconnects to the LDAP server if a connection is lost.
We should try to connect to the server again in a defined interval when the server is not reachable.
In this bug we should not try to iterate among the different LDAP servers.
UCR variables suggestion:
ldap/client/retry/number=<number of retries>
ldap/client/retry/wait=<seconds waiting before next retry>
^^^^^ ==> wait
I doubt that the slapd is ready within 5 seconds after initiating a restart.
I would suggest to wait about 30 seconds. What about using an exponentially increasing timeout with given minimum (e.g. 1) and maximum value (e.g. 5)?
(In reply to Sönke Schwardt-Krummrich from comment #1)
> > Defaults:
> > ldap/client/retry=true
> > ldap/client/retry/count=5
> > ldap/client/retry/count=1
> ^^^^^ ==> wait
> I doubt that the slapd is ready within 5 seconds after initiating a restart.
> I would suggest to wait about 30 seconds. What about using an exponentially
> increasing timeout with given minimum (e.g. 1) and maximum value (e.g. 5)?
In my tests it took round about one or two seconds. But you are right we should use a higher value.
I would suggest we use only one variable for the count and wait for always one second. I think it is much easier:
First code was added to univention.uldap (r48474). The following things are still missing:
- UCR description
(In reply to Stefan Gohmann from comment #3)
> First code was added to univention.uldap (r48474). The following things are
> still missing:
> - YAML
> - Cleanup
> - UCR description
> - Tests
The name of the variable is now ldap/client/retry/count and it is set to 10 by default. This means uldap tries it again for 10 times. This value is also given to the LDAPReconnectObject instance.
The UCR description was added to univention-base-files.
- univention-python: r48474, r48498, r48520
- univention-base-files: r48479, r48519, r48539
- univention-python: r48540
- univention-base-files: r48540
- r48477, r48478, r48487, r48507
UMC still works when slapd runs only intermittently.
ldap/client/retry/count works as advertised.