dns: merge branch 'bg/dns-child-restart-issue105'

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/105
(cherry picked from commit 240e2bd9f8)
This commit is contained in:
Beniamino Galvani 2019-01-14 10:46:09 +01:00
commit 49853fa7c1
2 changed files with 11 additions and 3 deletions

View file

@ -254,9 +254,16 @@ name_owner_changed (GObject *object,
priv->running = TRUE;
send_dnsmasq_update (self);
} else {
_LOGI ("dnsmasq disappeared");
priv->running = FALSE;
g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED);
if (priv->running) {
_LOGI ("dnsmasq disappeared");
priv->running = FALSE;
g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED);
} else {
/* The only reason for which (!priv->running) here
* is that the dnsmasq process quit. We don't care
* of that here, the manager handles child restarts
* by itself. */
}
}
}

View file

@ -1580,6 +1580,7 @@ plugin_child_quit (NMDnsPlugin *plugin, int exit_status, gpointer user_data)
} else {
priv->plugin_ratelimit.num_restarts++;
if (priv->plugin_ratelimit.num_restarts > PLUGIN_RATELIMIT_BURST) {
plugin_failed (plugin, self);
_LOGW ("plugin %s child respawning too fast, delaying update for %u seconds",
nm_dns_plugin_get_name (plugin), PLUGIN_RATELIMIT_DELAY);
priv->plugin_ratelimit.timer = g_timeout_add_seconds (PLUGIN_RATELIMIT_DELAY,