https://bugs.kde.org/show_bug.cgi?id=525911

Nate Graham <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/plas |https://invent.kde.org/plas
                   |ma/plasma-workspace/-/commi |ma/plasma-workspace/-/commi
                   |t/05ad367e99af513e174c12968 |t/f0d1bd007cd77b8925ea7681f
                   |d06a2f33f305c75             |64960df4c3bd05c

--- Comment #14 from Nate Graham <[email protected]> ---
Git commit f0d1bd007cd77b8925ea7681f64960df4c3bd05c by Nate Graham, on behalf
of David Edmundson.
Committed on 26/09/2026 at 00:48.
Pushed by ngraham into branch 'Plasma/6.7'.

plasma-shutdown: Guard against concurrent logout/reboot/shutdown requests

A second, overlapping call to logout()/logoutAndShutdown()/logoutAndReboot()
while one is already in progress starts a duplicate startLogout() flow in
the same process. Both flows eventually call KWin's
SessionManager::closeWaylandWindows(), which correctly rejects the second,
overlapping call with "Operation already in progress". That rejection is
currently treated as fatal: Shutdown::ksmServerComplete() reacts to it by
calling resetLogout() and logoutCancelled(), which calls qApp->quit() and
tears down the whole plasma-shutdown process - including the first,
legitimate request that was still in flight and would very plausibly have
completed successfully on its own.

In practice this can be triggered by a client issuing the D-Bus call twice
in quick succession (e.g. observed with Discover's "Reboot after update"
firing org.kde.Shutdown.logoutAndReboot twice, ~400 microseconds apart, due
to a QML state re-entry issue). The user ends up with all applications
closed but the session never actually logging out or rebooting.

This adds a simple re-entrancy guard: a second concurrent request is
ignored (logged and returned early) instead of racing a duplicate flow
against the first one. Confirmed against a live reproduction: deliberately
issuing logoutAndReboot() twice in rapid succession, which reliably
reproduced the crash before this change, now completes the first request
cleanly with no collision.


(cherry picked from commit f2af69292edab289cec0735a438dc893b0792edc)

Co-authored-by: Gregor Papez <[email protected]>

M  +8    -0    startkde/plasma-shutdown/shutdown.cpp
M  +8    -0    startkde/plasma-shutdown/shutdown.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/f0d1bd007cd77b8925ea7681f64960df4c3bd05c

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to