grnet / webdns4

A Ruby-on-Rails Webdns Frontend for Powerdns
2 stars 2 forks source link

Handle mysql restarts gracefully in dnsworker #14

Closed alexkiousis closed 6 years ago

alexkiousis commented 6 years ago
Jun 14 20:12:34 nspri4 dns-worker[26940]: /srv/dnsworker/lib/dnsworker/base_worker.rb:65:in `query': Lost connection to MySQL server during query (Mysql2::Error)
Jun 14 20:12:34 nspri4 dns-worker[26940]: from /srv/dnsworker/lib/dnsworker/base_worker.rb:65:in `run'
Jun 14 20:12:34 nspri4 dns-worker[26940]: from /srv/dnsworker/lib/dnsworker/base_worker.rb:57:in `block in watch'
Jun 14 20:12:34 nspri4 dns-worker[26940]: from /srv/dnsworker/lib/dnsworker/base_worker.rb:53:in `loop'
Jun 14 20:12:34 nspri4 dns-worker[26940]: from /srv/dnsworker/lib/dnsworker/base_worker.rb:53:in `watch'
Jun 14 20:12:34 nspri4 dns-worker[26940]: from /srv/dnsworker/lib/dnsworker/base_worker.rb:22:in `work'
Jun 14 20:12:34 nspri4 dns-worker[26940]: from /srv/dnsworker/bin/dns-worker:49:in `<main>'
Jun 14 20:12:34 nspri4 systemd[1]: dnsworker.service: main process exited, code=exited, status=1/FAILURE
Jun 14 20:12:34 nspri4 systemd[1]: Unit dnsworker.service entered failed state.

This could be implement in the application level but systemd also has some powerful restart abilities, investigate.