Bug 483136

Summary: plasmashell doesn't wait for kconf_update
Product: [Plasma] plasmashell Reporter: Fabian Vogt <fabian>
Component: Startup processAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kde, kilgore.trout, nate
Priority: NOR    
Version First Reported In: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Fabian Vogt 2024-03-10 17:07:57 UTC
openQA found that after upgraing from Plasma 5, the panel becomes floating: https://openqa.opensuse.org/tests/4003016#step/opensuse_welcome/17

One part of the issue was fixed by https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4030. However, openQA was still unhappy. Looking at the journalctl output shows that kconf_update was still busy even after plasmashell launched.
While various other processes like kwin handle this, plasmashell does not: It neither waits for kconf_update nor is capable of handling runtime changes.

In this particular case it ended up reading plasmashellrc pre kconf_update (no "floating=" setting) and writing updated settings back (including "floating=1"). Depending on when kconf_update runs, three possible series of events can happen:

a) kconf_update completes, writing floating=0 and plasmashell ends up reading that -> success. Very unlikely to happen.
b) plasmashell reads plasmashellrc, then kconf_update runs and writes floating=0, then plasmashell ends up overwriting that with its internal default
c) b) plasmashell reads plasmashellrc, then plasmashell overwrites it with internal defaults (floating=1), then kconf_update runs an does nothing because floating is already present

FWICT plasmashell should be serialized to start only after kded is up. Calling KConfig::checkUpdate would probably result in more races (see kconfig documentation...). Using qdbus worked in my tests:

/usr/lib/systemd/user/plasma-plasmashell.service.d/waitforkded.conf:
[Service]
ExecStartPre=/usr/bin/qdbus6 org.kde.kded6 /kded org.kde.kded6.loadedModules: