Database reconnect settings ignored during startup
Describe the bug
During startup if the database is unreachable (which is easily possible during boot since there is, understandably, no dependency/ordering on sql servers in the default systemd unit) kea-server will immediately shut down despite reconnect settings. Since there is a chance for the SQL database to be available after kea is being started this can lead to kea not running after boot despite being expected to.
To Reproduce
Steps to reproduce the behavior:
- Configure Kea with mysql leases/reservations including reconnect options ("max-reconnect-tries": 10,"reconnect-wait-time": 1000)
- Stop and start kea + mysql, kea before mysql
service isc-kea-dhcp4-server stop; service mysql stop; service isc-kea-dhcp4-server start; service mysql start; sleep 1; service isc-kea-dhcp4-server status;
- See that no reconnect attempts were made
Expected behavior
Kea to use the reconnect options during startup
Environment:
- Kea version: 1.6.0
- OS: Ubuntu 18.04 x64
- From ISC Kea repository
- If/which hooks where loaded in: lease-commands, ha