Bug 491745

Summary: Logout sound delays initiating logout process rather than prolonging its completion when needed
Product: [Plasma] plasmashell Reporter: Stephan <stephan.rennert>
Component: Session ManagementAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: natalie_clarius, nate, selpix, sitter, spam_eater
Priority: NOR Keywords: regression
Version First Reported In: 6.1.4   
Target Milestone: 1.0   
Platform: Fedora RPMs   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=505097
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: This particular sound causes this bug.

Description Stephan 2024-08-15 09:51:00 UTC
SUMMARY

In KDE 5 (Fedora 39) I can click the shutdown button and immediately get a response in the form of a changed screen. Both on shutdown and on restart, both with and without logoff screen.
In KDE 6 (Fedora 40) I have a delay on shutdown and reboot, both with and without logoff screen.

I have created a video for comparison. Fedora 39 and 40 on the same Proxomox host with identical parameters.

This video shows the comparison:
https://my.hidrive.com/lnk/SVj4a2AcT

In the video it is Fedora 40 (KDE Plasma 6.0.3) after a fresh installation. Even after installing all updates (KDE Plasma 6.1.4), the problem with the delay still exists. If I open a console and enter 'reboot' the system immediately reboots.

The delay is about 3 seconds in the Proxmox VMs. On my laptop the delay is about 7 seconds.

I hope the video can make it a bit clearer.

OBSERVED RESULT
dealy after clicking the button until something happens

EXPECTED RESULT
Instant reaction after clicking the button

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.1.4
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-08-15 14:13:02 UTC
Thanks for the extremely detailed, clear, and overall high quality video demonstrating the bug. That must have taken some time to put together. Much appreciated.

In general, when this happens, it's because there's a process that doesn't quit immediately after ksmserver sends the "system going down, everyone quit now" signal. So it could be that, or it could actually be an unintentional delay in ksmserver itself. Needs investigation.
Comment 2 TomK 2024-08-15 17:06:08 UTC
I observe the same problem when clicking on the "shutdown" button (not only reboot). It takes about 3 seconds until I have some visual feedback that I actually clicked the button. I have configured the power button on my laptop to initiate a shutdown. Same behaviour there. 

My system: 

Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.3-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i7-7500U CPU @ 2.70GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 620
System Version: ThinkPad T470s
Comment 3 selpix 2024-09-10 04:01:02 UTC
Can confirm this issue. Also noticed if you turn off shutdown/restart sounds it works instantly as it should.
Comment 4 Stephan 2024-09-11 08:09:04 UTC
(In reply to selpix from comment #3)
> Can confirm this issue. Also noticed if you turn off shutdown/restart sounds
> it works instantly as it should.

I can confirm that it shuts down instantly by deactivating this specific sound.

Thx for this hint.
Comment 5 Nate Graham 2024-09-16 15:30:58 UTC
Which sound, exactly? > System Settings > Notifications > System Notifications > Logout? Or something else?
Comment 6 selpix 2024-09-16 15:48:53 UTC
Created attachment 173728 [details]
This particular sound causes this bug.
Comment 7 Nate Graham 2024-09-16 16:38:08 UTC
Thanks, in that case I can reproduce the issue exactly as you can. Looks like the logout sound delays initiating the actual logout process.

Probably it should not delay initiating the process, but rather prolong its completion in the case where the sound plays for a longer time than it takes to log out.
Comment 8 Harald Sitter 2025-01-17 12:32:18 UTC
https://invent.kde.org/plasma/plasma-workspace/-/commit/c445f99304bd0190a7a0b83e4700222132bc34d1

This appears to have been intentional. If we don't wait for the logout sound then it will just not play at all.