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 778288 - "network_changed" signal emitted periodically
"network_changed" signal emitted periodically
Status: RESOLVED NOTABUG
Product: glib
Classification: Platform
Component: network
2.50.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-02-07 14:27 UTC by Gautier Pelloux-Prayer
Modified: 2017-02-07 16:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gautier Pelloux-Prayer 2017-02-07 14:27:40 UTC
While working on Geary I hit bug 776042: given my network provider (Orange, France) and network settings (IPv6 enabled both in network manger and on the box), I can see the network_changed signal emitted every 40sec (±10sec)

Running `sudo ip monitor` for 80sec (3 signals fired) I can see in logs:

> fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 lladdr BOX_IPV6 router STALE
> 2: wlp1s0    inet6 MY_IPV6 scope global noprefixroute dynamic 
>        valid_lft 900sec preferred_lft 300sec
> 2: wlp1s0    inet6 fe80::2ffa:1565:b688:5889/64 scope link 
>        valid_lft forever preferred_lft forever
> BOX_PREFIX::/64 dev wlp1s0 proto ra metric 600  pref medium
> fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 proto static metric 600  pref medium
> default via fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 proto static metric 600  pref medium
> fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 lladdr BOX_IPV6 router PROBE
> fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 lladdr BOX_IPV6 router REACHABLE
> 2: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> 
>     link/ether 
> 2: wlp1s0    inet6 MY_IPV6 scope global noprefixroute dynamic 
>        valid_lft 900sec preferred_lft 300sec
> 2: wlp1s0    inet6 fe80::2ffa:1565:b688:5889/64 scope link 
>        valid_lft forever preferred_lft forever
> BOX_PREFIX::/64 dev wlp1s0 proto ra metric 600  pref medium
> fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 proto static metric 600  pref medium
> default via fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 proto static metric 600  pref medium
> fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 lladdr BOX_IPV6 router STALE
> fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 lladdr BOX_IPV6 router PROBE
> fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 lladdr BOX_IPV6 router REACHABLE
> 2: wlp1s0    inet6 MY_IPV6 scope global noprefixroute dynamic 
>        valid_lft 900sec preferred_lft 300sec
> 2: wlp1s0    inet6 fe80::2ffa:1565:b688:5889/64 scope link 
>        valid_lft forever preferred_lft forever
> BOX_PREFIX::/64 dev wlp1s0 proto ra metric 600  pref medium
> fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 proto static metric 600  pref medium
> default via fe80::b2b2:8eee:ae34:2b8 dev wlp1s0 proto static metric 600  pref medium
> dev vethf840fb2 lladdr 02:42:ac:11:00:02 REACHABLE

Might be it related to this older Ubuntu bug: https://bugs.launchpad.net/whoopsie/+bug/991481 ?

If the signal has to be fired, what can we do, as API user (ie Geary) to detect this and avoid checking if IMAP server is still up every 40sec?
Comment 1 Emmanuele Bassi (:ebassi) 2017-02-07 14:39:33 UTC
I'm not sure why you filed this bug, since it seems your connection is being reset periorically, and the networking subsystem is behaving as expected.

I would seriously consider opening a support ticket with your ISP.

If you want to be able to deal with lousy connections in your application, one way would be to keep a boolean state variable that you set to TRUE the first time you check for the IMAP server being up every 5 minutes:

  #define FIVE_MINUTES 5 * 60 * 1000000L

  static bool imap_server_was_up = false;
  static int64_t last_check = -1;

  if (last_check < 0)
    last_check = g_get_monotonic_time ();

  if (!imap_server_was_up ||
      (g_get_monotonic_time () - last_check) > FIVE_MINUTES)
    imap_server_was_up = is_server_up(imap_server_host);

if you want to avoid DoS'ing the IMAP server but still retain the ability to check whether or not the server is up.
Comment 2 Gautier Pelloux-Prayer 2017-02-07 16:42:19 UTC
Thanks Emmanuele. I wasn't sure if the issue was with my internet provider or with glib so I just wanted to be sure before going any further. You confirmed that this is more alike a ISP issue, so I'll try to contact their support.
In the mean time I guess we have no choice but use a timer as you suggest for Geary. Thanks!