Bug 399341

Summary: all backends + no internet = GUI update blocked for literal seconds
Product: [Applications] Discover Reporter: Harald Sitter <sitter>
Component: discoverAssignee: Aleix Pol <aleixpol>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: bt (NB: this was of two runs, both stuck in fwupd it seems)
cli output

Description Harald Sitter 2018-10-03 16:06:07 UTC
Created attachment 115387 [details]
bt (NB: this was of two runs, both stuck in fwupd it seems)

On master when all backends are installed but no internet connection is available discover will consistently get blocked on UI updates for numerous seconds. After  a while it will unlock to show network errors.


STEPS TO REPRODUCE
1. Have no internets
2. reboot (does not happen after discover was started once it seems)
3. start discover

OBSERVED RESULT

discover fails to draw the UI for multiple seconds 

EXPECTED RESULT

discover should be fully drawn/redraw and be interactive while it's waiting for backend results


SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: master 
KDE Frameworks Version: master
Qt Version: 5.11.1

ADDITIONAL INFORMATION

I've tried with various backend combinations to trigger the issue, while each backend has a marginal "Freeze" portion early on only the complete combo of packagekit,fwupd,snap,kns,flatpak seems to actually cause the freeze to last multiple seconds.

I've ran this in gdb and the main thread seems to be executing fwupd stuff at the time the UI is stuck, why the fwupd stuff suddenly takes longer with a full backend lineup versus just fwupd is anyone's guess though.
Comment 1 Harald Sitter 2018-10-03 16:14:39 UTC
Created attachment 115388 [details]
cli output
Comment 2 Aleix Pol 2018-10-10 23:51:37 UTC
Git commit 2623dae7b9ff2f89887f8e9a5f3268a5a57deedd by Aleix Pol.
Committed on 10/10/2018 at 23:49.
Pushed by apol into branch 'Plasma/5.14'.

fwupd: move blocking dbus call into the initialization thread

M  +23   -33   libdiscover/backends/FwupdBackend/FwupdBackend.cpp
M  +5    -10   libdiscover/backends/FwupdBackend/FwupdBackend.h

https://commits.kde.org/discover/2623dae7b9ff2f89887f8e9a5f3268a5a57deedd