After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 760691 - NM keeps trying to restart failing DNS plugins
NM keeps trying to restart failing DNS plugins
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-01-15 22:24 UTC by Beniamino Galvani
Modified: 2016-01-21 09:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] dns-manager: prevent DNS plugins from respawning too quickly (5.27 KB, patch)
2016-01-15 22:26 UTC, Beniamino Galvani
none Details | Review

Description Beniamino Galvani 2016-01-15 22:24:34 UTC
If dnsmasq (or another DNS plugin) exits immediately (for example due
to an already used port), the DNS manager keeps restarting it forever,
wasting system resources and filling logs.

 ...
 15:07:21 <info>  DNS: starting dnsmasq...
 15:07:21 dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use
 15:07:21 <warn>  dnsmasq exited with error: Network access problem (address in use; permissions; etc) (2)
 15:07:21 <warn>  DNS: plugin dnsmasq child quit unexpectedly; refreshing DNS
 15:07:21 <info>  DNS: starting dnsmasq...
 15:07:21 dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use
 15:07:21 <warn>  dnsmasq exited with error: Network access problem (address in use; permissions; etc) (2)
 15:07:21 <warn>  DNS: plugin dnsmasq child quit unexpectedly; refreshing DNS
 15:07:21 <info>  DNS: starting dnsmasq...
 15:07:21 dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use
 15:07:21 <warn>  dnsmasq exited with error: Network access problem (address in use; permissions; etc) (2)
 15:07:21 <warn>  DNS: plugin dnsmasq child quit unexpectedly; refreshing DNS
 ....
Comment 1 Beniamino Galvani 2016-01-15 22:26:45 UTC
Created attachment 319154 [details] [review]
[PATCH] dns-manager: prevent DNS plugins from respawning too quickly
Comment 2 Thomas Haller 2016-01-20 09:54:05 UTC
I think that for g_child_watch_add() we should not call g_source_remove() inside the callback.

-    nm_clear_g_source (&priv->watch_id);
+    priv->watch_id = NULL;

Isn't the change to watch_cb() an unrelated bugfix? Maybe move it to a separate patch?



nm_utils_get_monotonic_timestamp_ms() returns (signed) gint64 because that plays better when diffing two timestamps (so that you get a negative value, when the subtrahend is in the future). Lets have the data type for "ts" consistent as signed too.


otherwise, lgtm
Comment 3 Beniamino Galvani 2016-01-21 09:47:51 UTC
(In reply to Thomas Haller from comment #2)
> I think that for g_child_watch_add() we should not call g_source_remove()
> inside the callback.
> 
> -    nm_clear_g_source (&priv->watch_id);
> +    priv->watch_id = NULL;
> 
> Isn't the change to watch_cb() an unrelated bugfix? Maybe move it to a
> separate patch?

There wasn't a real bug before because the watch callback emitted a signal which caused a restart of the plugin and thus a clear of the source. So let's consider this a consequence of the rework.

> nm_utils_get_monotonic_timestamp_ms() returns (signed) gint64 because that
> plays better when diffing two timestamps (so that you get a negative value,
> when the subtrahend is in the future). Lets have the data type for "ts"
> consistent as signed too.

Fixed and applied to master:

http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=64ac9101316471cce38f360d438dd8f948de6dcb