Do graceful shutdown when kea-dhcpX cannot reconnect the a DB
Currently, the kea servers fail to reconnect to the database, the DatabaseConnection implementations call exit() (e.g.MySqlConnection::check_error()). This does not always leave things in a tidy state. We should do an orderly shutdown:
-
In ControlledDhcpv<4/6>Srv::dbLostCallback(), when retries have been exhausted, schedule a shutdown by invoking processCommand("shutdown")
-
In MySqlConnection::check_error(), removing the call to exit() when callback invocation fails and it simply throw an exception. This allows the calling layer to error handle cleanly.
I tried this and it seems work nicely. The exit() was part of the original solution which was done a long time ago.
This is an adjunct to #1097 (closed).
Edited by Thomas Markwalder