Bug 401304 - maybe inhibit suspend during updates
Summary: maybe inhibit suspend during updates
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: Updates (interactive) (show other bugs)
Version: unspecified
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 430960 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-11-22 11:52 UTC by Harald Sitter
Modified: 2022-08-24 10:30 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.7


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2018-11-22 11:52:19 UTC
Live updates have a potential to break stuff, this is somewhat more problematic if systems are allowed to suspend while doing an update. If the update included nvidia the screenlocker will be defunct because of nvidia things, possibly certainl qml/qt changes can also cause this (though I feel like we've put safe guards in place a while back)

The long term answer to this is that nvidia should be an offline update, but since offline updates aren't quite production-ready we could benefit from a solution in the meantime.

It may be smart to inhibit sleep during update *installation*.

Concerns raised: what if the user closes the lid and puts the laptop in a bag?
Comment 1 Nate Graham 2018-11-26 22:09:56 UTC
Yes please!
Comment 2 David Edmundson 2020-02-20 23:00:24 UTC
There's also no point inhibiting during the download phase, only the transaction. I'm not sure if we have access to that.

My gut reaction is this is the job of the underlying package system and any patches should be submitted there.
Comment 3 Nate Graham 2021-01-05 02:39:58 UTC
*** Bug 430960 has been marked as a duplicate of this bug. ***
Comment 4 kortrax11 2022-01-25 09:14:56 UTC
Please implement this. I’ve had instances where a computer would not wake from suspend (black screen) if suspended during an update. Force shutting it down resulted in system damage even after waiting 30 mins in hopes that the update would complete. You are lucky if you get the [Screen locker is broken] message as opposed to this!
Comment 5 Raphaël Jakse 2022-04-24 06:55:28 UTC
Zypper on openSUSE indeed does this: it blocks the computer from going to suspend during updates.

> Concerns raised: what if the user closes the lid and puts the laptop in a bag?

It indeed happened to me several times that the system refuses to go on suspend without me noticing because of an update. I'm often not putting the computer in my bag at those times. When I put the computer in my bag, I'm extra careful that it did go to suspend.

I have two imperfect ideas:
 - produce some sort of signal when the system refuses to suspend (for whatever reason). But the screen is not visible and the sound might be muted (or undesirable)
 - make sure to put the laptop on suspend after the updates are done. That would be a neat solution for my case: closing the lead would mean: go to sleep as soon as possible, after finishing whatever task that needs to be finished before.
Comment 6 Reziac 2022-07-23 21:21:55 UTC
Geez yes. I stopped using Discover for updates, because suspend halts the download in midstream (almost every time given how slow my connection is), sometimes halts installation, and then I have to use the CLI to make it finish anyway. Please, give us an option to NOT SUSPEND AT ALL until the whole update process is finished.

[To be fair, I have the same issue with Synaptic. Is there any way to intercept "software installation" and make it NOT SUSPEND regardless of which software manager is in use?]
Comment 7 Nate Graham 2022-08-22 15:20:37 UTC
When we're inhibiting suspend, it only inhibits *automatic* suspend; you can still suspend manually by clicking "Sleep" in Kickoff etc. or closing your laptop's lid. So if we implement this, it wont hurt anything if you for example absent-mindedly start an update and then close your laptop lid to take it somewhere.
Comment 8 Bug Janitor Service 2022-08-23 19:05:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/352
Comment 9 Aleix Pol 2022-08-24 09:21:05 UTC
Git commit db089e0dc29cf33c0112cc2649d37da1d6cd7386 by Aleix Pol i Gonzalez.
Committed on 24/08/2022 at 00:07.
Pushed by apol into branch 'master'.

Request inhibiting sleep while transactions are on

M  +1    -0    discover/CMakeLists.txt
M  +2    -0    discover/DiscoverObject.cpp
A  +159  -0    discover/PowerManagementInterface.cpp     [License: LGPL(v3.0+)]
A  +76   -0    discover/PowerManagementInterface.h     [License: LGPL(v3.0+)]
M  +5    -0    discover/qml/DiscoverWindow.qml
M  +13   -0    libdiscover/Transaction/TransactionModel.cpp
M  +4    -0    libdiscover/Transaction/TransactionModel.h

https://invent.kde.org/plasma/discover/commit/db089e0dc29cf33c0112cc2649d37da1d6cd7386
Comment 10 Aleix Pol 2022-08-24 09:21:56 UTC
Git commit 70298e9311a7a336f2c0b7ee2a5c8f2bff069dfd by Aleix Pol Gonzalez, on behalf of Aleix Pol i Gonzalez.
Committed on 24/08/2022 at 09:21.
Pushed by apol into branch 'Plasma/5.25'.

Request inhibiting sleep while transactions are on


(cherry picked from commit db089e0dc29cf33c0112cc2649d37da1d6cd7386)

M  +1    -0    discover/CMakeLists.txt
M  +2    -0    discover/DiscoverObject.cpp
A  +159  -0    discover/PowerManagementInterface.cpp     [License: LGPL(v3.0+)]
A  +76   -0    discover/PowerManagementInterface.h     [License: LGPL(v3.0+)]
M  +5    -0    discover/qml/DiscoverWindow.qml
M  +13   -0    libdiscover/Transaction/TransactionModel.cpp
M  +4    -0    libdiscover/Transaction/TransactionModel.h

https://invent.kde.org/plasma/discover/commit/70298e9311a7a336f2c0b7ee2a5c8f2bff069dfd
Comment 11 Aleix Pol 2022-08-24 09:22:35 UTC
Git commit 6a5b862298989b66854abf05039618d629fe7f69 by Aleix Pol Gonzalez, on behalf of Aleix Pol i Gonzalez.
Committed on 24/08/2022 at 09:22.
Pushed by apol into branch 'Plasma/5.24'.

Request inhibiting sleep while transactions are on


(cherry picked from commit db089e0dc29cf33c0112cc2649d37da1d6cd7386)

M  +1    -0    discover/CMakeLists.txt
M  +2    -0    discover/DiscoverObject.cpp
A  +159  -0    discover/PowerManagementInterface.cpp     [License: LGPL(v3.0+)]
A  +76   -0    discover/PowerManagementInterface.h     [License: LGPL(v3.0+)]
M  +5    -0    discover/qml/DiscoverWindow.qml
M  +13   -0    libdiscover/Transaction/TransactionModel.cpp
M  +4    -0    libdiscover/Transaction/TransactionModel.h

https://invent.kde.org/plasma/discover/commit/6a5b862298989b66854abf05039618d629fe7f69