Bug 464405

Summary: Give each widget its own process so widgets can't cause plasmashell to hang or crash
Product: [Plasma] plasmashell Reporter: Puspam Adak <puspitaadak9876>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: kde, nate, nicolas.fella
Priority: NOR    
Version First Reported In: 5.26.5   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Puspam Adak 2023-01-17 12:29:47 UTC
SUMMARY
I have seen that if a particular panel widget hangs, the whole panel becomes unresponsive to input (both mouse & keyboard). This can be seen better when your system have low memory & some of the widgets get swapped to disk.

STEPS TO REPRODUCE
1. Do something which can cause your PC's memory to get exhausted. Then open any intensive widget (such as the application menu, audio menu or digital clock.
2. If your system have swapped those widgets, those will take a few seconds to open. With that time, try moving the mouse over some other widget. They won't respond to mouse hover/click. Even keyboard shortcuts won't work (such as the Super key to open the application menu).
3. This issue can also be reproduced by introducing lag/runtime errors to any widget on purpose.

OBSERVED RESULT
Anything which is under plasmashell just stops responding to any input. The right-click menu on the desktop, application menu or any other widget doesn't work for a few seconds.

EXPECTED RESULT
Plasmashell should be responsive even if a widget stops responding.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.15.88-1-LTS (64-bit)
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Comment 1 Nate Graham 2023-01-17 21:34:05 UTC
Right now, widgets get run by the main plasmashell process. We could potentially improve this by giving each widget its own thread. Then a widget couldn't hang or crash plasmashell.
Comment 2 Nicolas Fella 2023-01-17 21:38:45 UTC
Different threads don't help at all with crashing. A crash in any thread will cause the whole thing to crash.

We would need different processes for that. It's probably doable, but with a significant cost, both in terms of complexity and resource usage. So it may not be worth it
Comment 3 Nate Graham 2023-01-17 22:02:16 UTC
Thanks for the clarification!
Comment 4 Puspam Adak 2023-01-17 22:34:43 UTC
(In reply to Nicolas Fella from comment #2)
> Different threads don't help at all with crashing. A crash in any thread
> will cause the whole thing to crash.
> 
> We would need different processes for that. It's probably doable, but with a
> significant cost, both in terms of complexity and resource usage. So it may
> not be worth it

I agree that separate threads won't help during a crash, but it will surely help to improve the responsiveness in general. It can prevent hanging the whole thing if 1 widget hangs for any reason.
Comment 5 Nate Graham 2023-04-27 18:38:55 UTC

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