Bug 360673 - kwin_x11 not ending properly on call for shutdown / reboot, causes 90 sec stop job delay. Logout is fine.
Summary: kwin_x11 not ending properly on call for shutdown / reboot, causes 90 sec sto...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.5.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://bbs.archlinux.org/viewtopic.p...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-17 19:18 UTC by Chris
Modified: 2016-08-27 16:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris 2016-03-17 19:18:29 UTC
Using KDE Plasma with SDDM, if I log out, I'm able to shutdown or reboot from there just fine. However if I skip the logout and click shutdown or reboot from the K menu, there's a delay of 90 seconds as a stop job is running. kwin_x11 seems to be the culprit, or a problem with systemd. Don't know which yet.

Reproducible: Always

Steps to Reproduce:
1. Click Shutdown or Reboot in the Leave menu.
2. Wait.

Actual Results:  
Have to wait an additional 90 seconds as a stop job is running.

Expected Results:  
Should shut down or reboot quickly.

http://pastebin.com/qqs7tpKv
Comment 1 Thomas Lübking 2016-05-31 12:34:39 UTC
According to the linked thread several processes seem affected and system 228 doesn't seem to expose the problem.
Anyway, kwin tries to redirect SIGHUP to QApplication::exit() and if that fails ignores the event (where I'm not so sure whether that's the best resolution, but I also doubt the map fails) so the problem will likely be in QApplication::exit()

Maybe it stumbles on a broken X11 connection?
Can you gdb into the pending process and dump a backtrace?
Comment 2 Martin Flöser 2016-05-31 15:27:43 UTC
actually sddm should kill everything from the session, see also: https://github.com/sddm/sddm/issues/636
Comment 3 Thomas Lübking 2016-05-31 15:42:49 UTC
That link seems about the epic "systemd broke nohup" concept.

Status quo (ante) is that everything in the shell should receive a SIGHUP by the shells termination and quit in return. This somehow seems to fail.
Then there'd be explicit SIGTERMs by new and objected logind behavior and only if that fails and as very last resort there should be (after a while) a SIGKILL.

If we fail on the SIGHUP, we'll likely fail the SIGTERM as well (same code path via QApplication::exit()) ie. there'd not even be a change by the new logind behavior and ultimately kwin_x11 would get nuked by the SIGKILL (which is not ignorable), but SIGKILL is a failsafe resort and no way a clean way to quit a process (thus the timeouts)

tl;dr - kwin should quit on SIGHUP, then forget about the rest of what I said (new loginctl is doing wrong in trying to fix broken clients. We're supposed to exit reliably on sighup. If we're broken, just fix us and do not rely on quirks of the session system)
Comment 4 Martin Flöser 2016-08-27 16:05:27 UTC
@Harald: what's the current state on fixing the shutdown+system timeout mess?
Comment 5 Chris 2016-08-27 16:47:52 UTC
Sorry, forgot I filed this. This isn't happening anymore.