Bug 377054

Summary: Krunner hangs for 1-2 second before popping when shortcut is pressed.
Product: [Plasma] krunner Reporter: mefyl <mefyl>
Component: generalAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED DUPLICATE    
Severity: normal CC: alexander.lohnau
Priority: NOR    
Version: 5.9.2   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Krunner strace.

Description mefyl 2017-03-01 10:14:29 UTC
Created attachment 104288 [details]
Krunner strace.

When using the "run command" shortcut (default: alt+space), it takes ~2s for the krunner popup to show up on my machine, which is not critical but can get quite annoying.

After stracing what happens between the shortcut press and the popup, it seems the main culprit are read and blocking polls on file descriptor 5:

10:42:01.789930 read(5, "\2\0\0\0\0\0\0\0", 16) = 8
10:42:01.789967 poll([{fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=15, events=POLLPRI}], 6, 467) = 1 ([{fd=5, revents=POLLIN}])
10:42:01.792028 read(5, "\1\0\0\0\0\0\0\0", 16) = 8
10:42:01.792059 poll([{fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=15, events=POLLPRI}], 6, 465) = 0 (Timeout)
10:42:02.257609 read(5, 0x7ffef446f060, 16) = -1 EAGAIN (Resource temporarily unavailable)
10:42:02.257670 poll([{fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=15, events=POLLPRI}], 6, 5) = 0 (Timeout)

This last timeouted poll alone blocks the process for 0.5s. Searching backwards, it seems fd 5 is an inotify watch on a theme file:

10:41:52.724462 inotify_add_watch(10, "/usr/share/icons/breeze/index.theme", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_DONT_FOLLOW) = 5

This could be caused by this write that seem to invoke "RestartStyle", on what I suppose is a DBUS socket ?

10:41:52.909666 write(7, "\1\f\1\0\10\0\0\0\1\0\0\0\0\0\0\0\20\0\0\0RestartStyle"..., 72) = 72

I do realise this might not be related to krunner but to the theme engine, but my understanding stops there.

Reproducible: always.

Steps to reproduce:

1. Press "Run command" shortcut (default: alt+space).
2. Popup takes 2s to show up.

Attached the full strace, with comments when the shortcut is pressed and when the popup actually shows up.
Comment 1 Alexander Lohnau 2020-07-11 14:43:31 UTC
Same issue like BUG 416145, although a more extreme case.

*** This bug has been marked as a duplicate of bug 416145 ***