Bug 406110 - Whole shell freezes for about 10-15 seconds when internet connection is lost
Summary: Whole shell freezes for about 10-15 seconds when internet connection is lost
Status: REOPENED
Alias: None
Product: plasma-nm
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: David Edmundson
URL:
Keywords:
: 437814 452948 457509 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-04-01 12:19 UTC by Vladimir Yerilov
Modified: 2022-08-05 18:50 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Yerilov 2019-04-01 12:19:19 UTC
SUMMARY
Hello.
I've been suffering from this since Plasma version 5.12 (when I came back to KDE distro, so maybe it is a long-term bug). Every time my internet connection is lost the whole Plasma shell begins to lag, and freeze,e.g. it takes like 10 seconds to respond to mouse click on an app menu or any plasmoid, sometimes network plasmoid opens and instantly freezes leaving its shadow above the desktop.
I've searched for similar issues and found one, where it was suggested to run plasma through Bumblebee's optirun (using Nvidia discrete GPU). I haven't played with it much but it seemed to work, so I think the problem is somehow related to i915 driver.

STEPS TO REPRODUCE
1. Cut off your internet connection (through router settings, for instance), but leave your wired or wireless connection intact.
2. Start mouseclicking on Plasma interface (weather / launcher / tray widgets).

OBSERVED RESULT
Whole shell freezes for a while (about 10-15 seconds).

EXPECTED RESULT
At least much more minor freezes, and it would be better to have no one.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Manjaro Linux 18.0.4, kernel 4.14-4.20 
(available in About System)
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION
A quick test of running plasmashell through optirun with above mentioned steps showed it is hard or impossible to reproduce this issue without i915 driver involvement, so the best testing machine to hunt this bug would be an Optimus laptop.
Comment 1 David Edmundson 2019-04-01 12:49:42 UTC
Please include output of the command "mount"
Comment 2 Vladimir Yerilov 2019-04-02 08:49:31 UTC
Hello.

$ mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=8138500k,nr_inodes=2034625,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/mapper/Manjaro-root on / type ext4 (rw,noatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13482)
systemd-1 on /media/asmt-nfs type autofs (rw,relatime,fd=36,pgrp=1,timeout=60,minproto=5,maxproto=5,direct,pipe_ino=13490)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
/dev/mapper/Manjaro-home on /home type ext4 (rw,noatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/nvme0n1p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/sda2 on /media/data type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1630572k,mode=700,uid=1000,gid=1001)

Best Regards,
Vladimir
Comment 3 Bug Janitor Service 2019-04-17 04:33:08 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Vladimir Yerilov 2019-04-17 04:49:53 UTC
Info provided as requested.
Comment 5 Vladimir Yerilov 2021-02-14 11:12:08 UTC
In recent Plasma versions, this is not the case anymore.
Comment 6 Vladimir Yerilov 2021-08-09 07:12:36 UTC
Hello guys.

I have to say that I was wrong. It is not resolved.
Let me try to describe this problem in more detail.
Every time my ISP has issues with its own or upstream equipment, my connection to the Internet is lost. That's normal. But what's not normal, is that it makes Plasma lag when trying to access Network Manager's applet (marked with exclamation mark near Wi-Fi icon indicating that current connection is limited) in Plasma panel in the following way: I press the icon, nothing happens for about 10-15 seconds, then the applet menu is shown, I click somewhere else, again I have to wait another 15 seconds for it to disappear.
There are other side-effects like logging in and out takes considerably more time than as usual (when the Internet is available). Sometimes a second log in takes about 5 minutes if I forget to disable Wi-Fi in the applet. Btw, this is the only way to work around these hiccups.
Some extra info: my Internet connection type is PPTP, and also I have Proxy auto-configuration config enabled in Systemsettings. I can try try to reproduce this bug again if anyone is willing to help me with debugging.

Thanks and waiting for your ideas.
Comment 7 Fushan Wen 2021-10-13 02:35:42 UTC
The bug is likely to be caused by network I/O blocking (network mount, etc.).
Comment 8 Fabian Vogt 2021-10-13 09:50:42 UTC
(In reply to qydwhotmail from comment #7)
> The bug is likely to be caused by network I/O blocking (network mount, etc.).

Unlikely, because this is not about the network connection but just the internet connection.

It's most likely a blocking call to one of the NetworkManager DBus interfaces (like the connection status query) which does blocking network activity.
Comment 9 Kai Uwe Broulik 2021-10-13 09:58:20 UTC
Yeah, networkmanager-qt is notorious for blocking. The problem is that even fire-and-forget setter calls cause a block in Qt DBus property system.

For instance, opening/closing the applet calls setDeviceStatisticsRefreshRateMs (to start or stop refreshing), this in turn calls setProperty("DeviceStatisticsRefreshRateMs", ...) which will then block in Qt DBus waiting for the reply because setProperty return true or false depending on whether the property assignment worked, even though nobody cares for that.

Likely there are other places where this happens. 

Running plasmashell with Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS=1 (or 0, but that is super verbose) could give us a better idea about which call blocks. Alternatively, you might want to run bustle or similar to check.
Comment 10 Bug Janitor Service 2021-10-16 08:42:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/603
Comment 11 Méven Car 2021-10-18 16:36:24 UTC
Git commit a4c711a411f47e11c5327efa0dd40c12b26875e5 by Méven Car, on behalf of Fushan Wen.
Committed on 18/10/2021 at 16:34.
Pushed by meven into branch 'master'.

taskmanager: Use SkipMimeTypeFromContent flag when creating KFileItem

This prevents plasmashell from freezing at opening the context menu
when there is no network and there are files on a network mount in
"Recent Files" section.
Related: bug 443465, bug 441077

M  +2    -6    applets/taskmanager/plugin/backend.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/a4c711a411f47e11c5327efa0dd40c12b26875e5
Comment 12 Nate Graham 2022-08-05 18:14:17 UTC
*** Bug 452948 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2022-08-05 18:14:23 UTC
*** Bug 437814 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2022-08-05 18:14:27 UTC
*** Bug 457509 has been marked as a duplicate of this bug. ***