Bug 294022 - ApperSentinel inhibits powermanager actions inappropriately
Summary: ApperSentinel inhibits powermanager actions inappropriately
Status: RESOLVED FIXED
Alias: None
Product: apper
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Daniel Nicoletti
URL:
Keywords:
Depends on:
Blocks: 289760
  Show dependency treegraph
 
Reported: 2012-02-13 21:20 UTC by Ryan Rix
Modified: 2012-02-15 20:27 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Rix 2012-02-13 21:20:54 UTC
Version:           unspecified (using Devel) 
OS:                Linux

Per https://bugs.kde.org/show_bug.cgi?id=289760#c70, it is no longer possible to suspend while apper-sentinel is running because it is inhibiting suspend if it is running, whether there are active PackageKit activities or not

Reproducible: Always

Steps to Reproduce:
# have the apper subsystem running
# Set up some powermanager actions (suspend on laptop lid closed, F.E.)
# trigger action


Actual Results:  
kded(1515) PowerDevil::PolicyAgent::AddInhibition: DBus service  ":1.285"  is
requesting inhibition
kded(1515) PowerDevil::PolicyAgent::AddInhibition: Added inhibition with cookie
 2  from  "ApperSentinel"  with  ""
kded(1515) PowerDevil::PolicyAgent::addInhibitionTypeHelper: Added interrupt
session

Apper prevents PowerDevil from following through with the action regardless of what is happening

Expected Results:  
Apper should only inhibit when there are activities in progress which could be dangerous to interrupt, such as updates or installations
Comment 1 Daniel Nicoletti 2012-02-14 00:49:30 UTC
Well actually it only grabs a cookie when something is running...
But really this never really worked reliable, because for some reason power devil seemed not to work properly.
I really thing this is a bug in power devil not Apper, since the code is rather simple, grab cookie drop cookie.
All tests I did this didn't work well
Comment 2 Ryan Rix 2012-02-14 01:02:44 UTC
Adding Dario as CC, can you two sort this out? I'm just a peoplemover, not a codemover :)
Comment 3 Daniel Nicoletti 2012-02-14 02:12:31 UTC
sure I asked Dario about this once, he said he found the bug and fixed but I really never managed to see this working right even after...
Maybe my code has a bug but the mechanism is rather simple.
Comment 4 Dario Freddi 2012-02-14 06:33:34 UTC
I might have a look at this today, now pd is fixed so the problem is on the other side. Can you please point me at the routine where inhibit is triggered?
Comment 6 Dario Freddi 2012-02-14 12:08:51 UTC
void TransactionWatcher::transactionListChanged(const QStringList &tids)
// release any cookie that we might have
93	
        suppressSleep(true);

Maybe you meant false? :)
Comment 7 Daniel Nicoletti 2012-02-14 14:02:06 UTC
hmm right that might be the problem, tho I think I set that to true because it wasn't suppressing sleep...
Can you point me how to make sure it is suppressing sleep? ie not suspend when lid closed or something?
Comment 8 Dario Freddi 2012-02-14 14:05:35 UTC
That one should be indeed false. The routine is correct apart from that, as your comment also suggests - when no transactions are running, you should release your inhibition. The overall code is fine, it's a mere logical error. The reason why it didn't work for you was probably because inhibition was pretty much broken before 4.8, I suppose.
Comment 9 Daniel Nicoletti 2012-02-14 14:27:18 UTC
Right, and now that it is working we have bug reports :P
I'll fix that and include in the upcoming version...
Thanks.
Comment 10 Ryan Rix 2012-02-14 21:57:42 UTC
Can you CCBUG your commit to this one? I know rdieter is looking to get KDE 4.8 in to Fedora 17 and having this bug addressed before then (even with a manual backport in to the current stable) would probably be a Good Thing for us.
Comment 11 Dario Freddi 2012-02-14 22:09:47 UTC
@Ryan: if you are in a real hurry, you just s/suppressSleep(true);/suppressSleep(false);/g in the line I pointed you to (93 in the file Daniel mentioned) and be happy :)
Comment 12 Daniel Nicoletti 2012-02-15 20:27:35 UTC
Bug fixed in:
http://commits.kde.org/apper/8e43cddd2634b03ee5a05f5287792bb006e903f8
Thanks for reporting it :D