Database connection: better defaults for max-reconnect-tries and reconnect-wait-time
Describe the bug Default value for "max-reconnect-tries" is 0, which can be problematic when it has been forgotten/overlooked during configuration (and IIRC most example configs don't include this parameter). In case of ie. an upgrade of the database package kea immediately dies because of losing connection when the database restarts.
To Reproduce Steps to reproduce the behavior:
- Run Kea (dhcpv4/6) with database lease storage without configuring "max-reconnect-tries" and "reconnect-wait-time"
- Have some traffic against kea
- Restart database
- See error: DATABASE_MYSQL_FATAL_ERROR Unrecoverable MySQL error occurred: unable to execute for <SELECT ....> DHCP4_DB_RECONNECT_DISABLED database reconnect is disabled: max-reconnect-tries 0, reconnect wait time 0 kea-dhcp4-server.service: Main process exited, code=exited, status=255/m/a
Expected behavior Some basic default values for max-reconnect-tries and reconnect-wait-time so kea doesn't die immediately when database has hiccups or is restarted
Environment:
- Kea version: 1.5 (From Ubuntu 19.10 packages)
- OS: Ubuntu 18.04 x64
- Which features were compiled in (in particular which backends)
- tarball
- linked with:
- log4cplus 1.1.2
- OpenSSL 1.1.1 11 Sep 2018
- database:
- MySQL backend 7.0, library 5.7.27
- PostgreSQL backend 5.0, library 100010
- Memfile backend 2.1 -
- If/which hooks where loaded in
Contacting you github/gitlab