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 792240 - NetworkManager takes too long to realize the connectivity is back to full
NetworkManager takes too long to realize the connectivity is back to full
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
1.8.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2018-01-05 13:51 UTC by Mathieu Bridon
Modified: 2018-04-10 20:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mathieu Bridon 2018-01-05 13:51:36 UTC
I use Fedora 27, with NetworkManager-1.8.4-7.fc27.x86_64 configured as follows:

```
$ cat /usr/lib/NetworkManager/conf.d/20-connectivity-fedora.conf
[connectivity]
uri=http://fedoraproject.org/static/hotspot.txt
response=OK
interval=300
```

(this comes from the NetworkManager-config-connectivity-fedora package)

Sometimes, NetworkManager won't manage to ping the connectivity uri, and consider that the connectivity is not full any more. That is, NM sees that the network is available but that the wider Internet is not reachable. (in GNOME, a "?" would be displayed instead of the Wi-Fi icon, for example)

The problem is that this can happen for transient errors, where the Internet connection is back very quickly, but NM will wait for the end of the next "interval" setting before retrying. (think poor Internet connection in some countries, or having your phone share its data connection while in the train)

When that happens, applications checking for full connectivity (e.g the whole GNOME desktop) will think they are offline, while other applications (e.g Firefox) will be perfectly capable of going online.

This is extremely confusing for users, who wonder why they can « browse the Internet » while GNOME and other apps tell them they are offline.

---

I can think of a couple of ways to make this a bit better.

1. When a connectivity check fails, maybe NM could hold off on notifying the world that the connectivity isn't full any more, and just try another check right away? If that second check fails as well, then this probably wasn't a transient network error, and it's time to consider the connectivity as limited, notifying the apps/desktop.

2. When NM has established that the connectivity was limited, maybe it shouldn't wait for the full interval, but rather try after 30 seconds, then again after 1 minute, etc... increasing the interval between each attempt. And when it reaches the "interval" setting, then further checks will all happen after this interval (i.e the "interval" setting becomes a maximum)

There might be other ways to improve the situation, probably better ideas even. :)
Comment 1 Bastien Nocera 2018-01-05 14:17:53 UTC
As I mentioned IRL, it might also be useful to have separate bugs for GNOME (likely Shell and Settings) to make it easier to reconnect to the same Wi-Fi AP through the menus, triggering a new connectivity check.
Comment 2 Thomas Haller 2018-02-25 00:24:59 UTC
1.) I don't agree, because if connectivity goes away -- even for a short time, then there really was a connectivity issue and NetworkManager should say so.
Arguably, with connectivity checking NetworkManager might easily miss a short outage due to the probing interval. But I don't think that NetworkManager should hide/delay the information, if it noticess the outage.

2.) should be done. Please review th/connectivity-rework branch --
https://github.com/NetworkManager/NetworkManager/pull/70
Comment 3 Thomas Haller 2018-04-10 14:05:39 UTC
pull-request #70 got merged as https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=84cd6aea53cb5e9ae9ec326ab450c88d921c12c8

Now when a device looses connectivity, it makes connectivity checks with an elevated frequency.

I think this is fixed. Please test, and reopen if necessary (or maybe, just open a new bug). Thanks.
Comment 4 Mathieu Bridon 2018-04-10 17:47:12 UTC
That's great, thanks Thomas!

Do you know in which release this would land, and when that release might come out? :)
Comment 5 Thomas Haller 2018-04-10 20:33:26 UTC
that would be the next major release: 1.12.0

Currently it's only on git-master.