GNOME Bugzilla – Bug 778288
"network_changed" signal emitted periodically
Last modified: 2017-02-07 16:42:19 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?
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.
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!