From 5ef8f456adae5e5f72e3bfac57686fcc0b2a10ba Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 11 Jan 2019 15:39:51 +0100 Subject: [PATCH] dns: fail the plugin when the rate limiter hits If the child is respawning too fast, consider the plugin failed so that upstream servers are written to resolv.conf until the plugin gets restarted after the delay. (cherry picked from commit e45636659b62ad8f19a03567269ea89e1252c9e3) --- src/dns/nm-dns-manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c index a44ff3c5f8..aebe3e12e9 100644 --- a/src/dns/nm-dns-manager.c +++ b/src/dns/nm-dns-manager.c @@ -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,