Bug 409392 - NetworkManager widget freezes on VPN connection issues, freezing/blocking Plasma
Summary: NetworkManager widget freezes on VPN connection issues, freezing/blocking Plasma
Status: RESOLVED FIXED
Alias: None
Product: plasma-nm
Classification: Plasma
Component: applet (show other bugs)
Version: 5.18.5
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: efficiency, usability
: 410859 416451 419443 423879 432947 443689 452067 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-02 04:36 UTC by alexgallotta
Modified: 2023-02-03 15:00 UTC (History)
27 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
status bar freezes after login (notice how the time jumps several hours) (2.50 MB, video/mp4)
2021-12-30 08:48 UTC, soshial
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alexgallotta 2019-07-02 04:36:21 UTC
SUMMARY
When time-consuming commands are triggered (e.g. connecting to a slow-to-connect wireless/wired network, connecting to a wireless/wired network with a very high packet loss or latency) from the NetworkManager widget,the whole plasma desktop is frozen until the command finishes.

STEPS TO REPRODUCE
1. Setup a wireless/wired network that takes several seconds to connect to, or to access the internet
2. try to connect to such network using the NetworkManager
3. click on other widgets or application launcher

OBSERVED RESULT
the widget panel will become stuck all other actions in plasma (like opening other widgets or the application launcher will be triggered once the NetworkManager finishes its action (regardless of failure/success)

EXPECTED RESULT
NetworkManager widget should stay responsive to user actions and not freeze. All other widgets and the rest of plasma should not be stuck

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
Operating System: Manjaro Linux 
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.59.0
Qt Version: 5.12.3
Kernel Version: 5.1.8-1-MANJARO
OS Type: 64-bit
Processors: 8 × Intel® Xeon® CPU E3-1505M v6 @ 3.00GHz
Memory: 31,3 GiB of RAM

ADDITIONAL INFORMATION
In normal day-to-day tasks, it can seem just a big laggy. When there are internet issues by ISP, switching from a network to the other causes the Plasma desktop to freeze continuously for 10 seconds or more

this issue https://bugs.kde.org/show_bug.cgi?id=299347 might be related
Comment 1 postix 2019-07-15 20:04:36 UTC
I can confirm this annoying issue, which I have experienced several when I tried to connect to a (by my self) wrongly configured network. 

SYSTEM

Operating System: Manjaro Linux 
KDE Plasma Version: 5.16.2
KDE Frameworks Version: 5.59.0
Qt Version: 5.13.0
Kernel Version: 5.1.16-1-MANJARO
Comment 2 Alexander Potashev 2019-12-20 19:46:49 UTC
*** Bug 410859 has been marked as a duplicate of this bug. ***
Comment 3 veggero 2020-03-25 18:08:47 UTC
Can confirm. Happens daily.

SYSTEM

Operating System: Manjaro Linux 
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.60.0
Comment 4 postix 2020-05-14 09:38:31 UTC
This issue is really giving me headache. I try to set up a VPN connection and besides OpenConnect forgetting the "saved credentials" all the time, additionally the system freezes for ~10-20 seconds, eg whenever I the connection fails. :-|

Is there anything we can do to help you debugging it?
Comment 5 postix 2020-07-01 09:23:26 UTC
*** Bug 416451 has been marked as a duplicate of this bug. ***
Comment 6 postix 2020-07-01 09:24:02 UTC
Just happened again, when I had issues with my internet connection due to provider failure. 

When opening the applet, the whole Plasma Desktop froze for quiet some time (increasing the frustration over the non-working internet even more).

However, switching the TTY, killing '/usr/bin/networkmanager' and switching back, made the desktop instantaneously smooth again.

Any idea how to debug this for you? This is really annoying. :-(
Comment 7 Jan Grulich 2020-07-14 20:22:39 UTC
*** Bug 419443 has been marked as a duplicate of this bug. ***
Comment 8 Jan Grulich 2020-07-14 20:22:45 UTC
*** Bug 423879 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2021-09-20 19:30:34 UTC
*** Bug 432947 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2021-10-18 16:07:53 UTC
*** Bug 443689 has been marked as a duplicate of this bug. ***
Comment 11 soshial 2021-11-20 18:19:16 UTC
In version 5.23.3 I observe much better connection to to WiFi and Wireguard: no freezes. Although in this particular scenario there are still significant freezes (every time for 4-8 seconds):

1. Turn ON both WiFi and Wireguard.
2. Turn OFF only WiFi.
Comment 12 Eduardo 2021-11-29 08:55:39 UTC
To me this still happens in 5.23.3 when there is a bad connectivity, for instance, not long ago I had a bad connection with my provider and there was 50% packet loss, anything I do on network applet, froze plasma for some time.
Comment 13 Fushan Wen 2021-11-29 13:18:45 UTC
(In reply to soshial from comment #11)
> In version 5.23.3 I observe much better connection to to WiFi and Wireguard:
> no freezes. Although in this particular scenario there are still significant
> freezes (every time for 4-8 seconds):
> 
> 1. Turn ON both WiFi and Wireguard.
> 2. Turn OFF only WiFi.

Cannot reproduce on git master. It could be also a bug in older versions of NetworkManager. On my system the version is 1.32.12
Comment 14 Kiril Vladimirov 2021-11-29 15:28:27 UTC
> Cannot reproduce on git master. It could be also a bug in older versions of NetworkManager. On my system the version is 1.32.12

Whether the particular bug in networkmanager-* (to me was in the openvpn plugin) gets fixed is irrelevant to this issue. IMHO it only uncovered a sub-optimal design decision in the widget. It all boils down to that plasma-nm blocks until a response from NetworkManager  comes which in turn blocks the whole plasma.
Comment 15 soshial 2021-12-30 08:48:03 UTC
Created attachment 144954 [details]
status bar freezes after login (notice how the time jumps several hours)
Comment 16 Fushan Wen 2022-01-17 02:07:58 UTC
(In reply to Kiril Vladimirov from comment #14)
> > Cannot reproduce on git master. It could be also a bug in older versions of NetworkManager. On my system the version is 1.32.12
> 
> Whether the particular bug in networkmanager-* (to me was in the openvpn
> plugin) gets fixed is irrelevant to this issue. IMHO it only uncovered a
> sub-optimal design decision in the widget. It all boils down to that
> plasma-nm blocks until a response from NetworkManager  comes which in turn
> blocks the whole plasma.

I can reproduce it now. Need a bad WiFi connection.
Comment 17 Unknown 2022-01-27 18:00:42 UTC
Can be easily reproduced with a router: remove WAN cable from the router and wait for 5 seconds. KDE Plasma will freeze for 30 seconds.
Comment 18 caleb 2022-03-04 15:36:39 UTC
Plasma 5.24.2 and Fedora 35 - seeing this exact same issue. Easiest way to trigger it, I have found, is start a wireguard connection and then put the computer to sleep. When it wakes, it takes a bit for the wireguard connection to come back online. In the interim, the entire system locks up. Anything that causes a connection to drop, even momentarily, makes Plasma unusable, sometimes until a reboot.
Comment 19 David Edmundson 2022-03-04 16:28:18 UTC
To find all blocking calls one can run:

Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS=0 plasmashell --replace |& grep org.freedesktop.NetworkManager

Don't paste it here. 

All are in the property fetching. We can do an obvious speedup by dropping some Gets that are then retrieved by a GetAll anyway for the same object and potentially some caching.

Ultimately we need this to be async. All issues are in libnm-qt
Comment 20 tidux 2022-03-29 19:19:14 UTC
The root cause of this on the NetworkManager side seems to be systemd-resolved choking on DNS changes.  Once I stop/disable/mask the systemd-resolved service, the freezing stops.
Comment 21 Nate Graham 2022-04-01 18:25:52 UTC
*** Bug 452067 has been marked as a duplicate of this bug. ***
Comment 22 David Edmundson 2022-04-01 22:06:01 UTC
Some of these blocking calls have been reduced. It would be good to know it the issue persists.
Comment 23 Dashon 2022-04-25 18:31:19 UTC
The issue does still persist, but the wait time is much shorter than before. I believe the reduced blocking calls are working, but the issue is not all the way gone.
Here's my system info:
Operating System: EndeavourOS
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.17.4-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3080/PCIe/SSE2
Comment 24 Dashon 2022-04-25 18:32:01 UTC
(In reply to Dashon from comment #23)
> The issue does still persist, but the wait time is much shorter than before.
> I believe the reduced blocking calls are working, but the issue is not all
> the way gone.
> Here's my system info:
> Operating System: EndeavourOS
> KDE Plasma Version: 5.24.4
> KDE Frameworks Version: 5.93.0
> Qt Version: 5.15.3
> Kernel Version: 5.17.4-arch1-1 (64-bit)
> Graphics Platform: X11
> Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
> Memory: 31.3 GiB of RAM
> Graphics Processor: NVIDIA GeForce RTX 3080/PCIe/SSE2

My apologies for getting back to you so late.
Comment 25 Dashon 2022-04-25 18:32:53 UTC
My apologies for getting back to you so late.
Comment 26 Dashon 2022-06-29 05:14:52 UTC
I no longer have this issue in 5.25.1. Might have been fixed in 5.25.0, but I didn't check then.
Comment 27 Nate Graham 2022-06-29 15:12:37 UTC
Can anyone else who was previously experiencing the issue confirm that?
Comment 28 David Edmundson 2022-06-29 15:38:42 UTC
There were some relevant patches to kde's network manager:

commit 6508fa524fa2d3ed058f7945fa9eb61b7647518d
Author: David Redondo <kde@david-redondo.de>
Date:   Thu Mar 10 12:01:28 2022 +0100

that removed some blocking calls.

It does not remove all blocking calls only cut it down significantly.
Comment 29 David Edmundson 2023-02-03 15:00:35 UTC
Please reopen if it's an issue affecting users after 5.27