Bug 223775 - "Suspend failed" message after sucessful suspend/resume
Summary: "Suspend failed" message after sucessful suspend/resume
Status: RESOLVED FIXED
: 222207 235124 246149 (view as bug list)
Alias: None
Product: openSUSE 10.2
Classification: openSUSE
Component: KDE (show other bugs)
Version: RC 1
Hardware: x86-64 Other
: P5 - None : Normal with 1 vote (vote)
Target Milestone: ---
Assignee: Will Stephenson
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-26 11:54 UTC by Andras Mantia
Modified: 2007-03-30 18:12 UTC (History)
1 user (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
ksmserver patch for the shutdown dialog (8.06 KB, text/plain)
2006-11-27 13:11 UTC, Holger Macht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Mantia 2006-11-26 11:54:13 UTC
Ocasionally I got a Suspend failed error message after resuming from a suspend to disk using the kickoff menu. Logs and some background is in bug #222523.
Comment 1 Dirk Mueller 2006-11-26 23:16:45 UTC
I can only guess what you're talking about, but I assuem that this error message comes from kpowersave. 
Comment 2 Andras Mantia 2006-11-26 23:32:37 UTC
I'm talking about this line:

KMessageBox::error(this, i18n("Suspend failed"));

from

void KMenu::slotSuspend(int id)
Comment 3 Will Stephenson 2006-11-27 09:07:38 UTC
Andras: 
It's because kpowersave makes a dbus call to suspend which does not return until you resume.  Since the call timeout on dbus is 6 hours, kpowersave sees this error.  AFAIK the kpowersave guys are aware of it.
Comment 4 Andras Mantia 2006-11-27 09:14:34 UTC
I see, this is why it happened only when I resumed in the morning. :-) I just wonder why Danny told me to assign this bug to the KDE guys. Or maybe I just misunderstood it.
Comment 5 Danny Al-Gaaf 2006-11-27 09:46:17 UTC
Maybe I oversaw something, but I checked out kdebase3 via getpac and I can't find where the KDE menu call KPowersave for suspend. 

last comment in kdebase3.changes:
-------------------------------------------------------------------
Sat Nov 25 13:32:52 CET 2006 - coolo@suse.de

- correctly handle media mounted on startup (#223413)
-------------------------------------------------------------------

I can only find the error message togehter with code where KDE suspend via HAL directly. I can't find the dcop call. Because of this the problem is in KDE (or liblazy) and not in KPowersave.

Btw. Didn't we agreed to call as first KPowersave to suspend before fallback to HAL/D-Bus directly? I can't find this in kdebase3.

Reassign and CC Holger ... he can maybe say more about liblazy.
Comment 6 Holger Macht 2006-11-27 10:52:14 UTC
(In reply to comment #5)
> Maybe I oversaw something, but I checked out kdebase3 via getpac and I can't
> find where the KDE menu call KPowersave for suspend. 

The kickoff menu doesn't call kpowersave at this point in time yet.

> liblazy) and not in KPowersave.
> 
> Btw. Didn't we agreed to call as first KPowersave to suspend before fallback to
> HAL/D-Bus directly? I can't find this in kdebase3.

Yes, we agreed on this but it's not in because noone did it yet.

> Reassign and CC Holger ... he can maybe say more about liblazy.

We realized that liblazy is not suitable for calling a sleep mode in HAL because it has a fixed tiemout set (about 25 seconds). I can change this because I already did it for the powersave cmd line client. But it would be really helpful if some of the KDE guys could test it once finished.
Comment 7 Holger Macht 2006-11-27 11:24:03 UTC
But I will only do the old ksmserver menu stuff. Afterwards, I will reassign this bug back.
Comment 8 Holger Macht 2006-11-27 13:04:53 UTC
*** Bug 222207 has been marked as a duplicate of this bug. ***
Comment 9 Holger Macht 2006-11-27 13:09:29 UTC
I'll attach a new patch agains the ksmserver shutdowndlg.cpp how it would look like in the build environment (after Re) which adds a function which sends a sleep request to hal, with INT_MAX as timeout and ignoring timeout errors.

I have no idea what's going on but KApplication::dcopClient()->send("kpowersave" ...) always returns true, regardless whether kpowersave is running or not. This seems to be a bug, no?

So at current point in time, with the attached patch, suspend only works if kpowersave is running. Reassigning because of this error and the kickoff stuff that still has to be done.
Comment 10 Holger Macht 2006-11-27 13:11:14 UTC
Created attachment 107023 [details]
ksmserver patch for the shutdown dialog
Comment 11 Danny Al-Gaaf 2006-11-27 13:28:14 UTC
hm ... you can maybe try instead of the current dcop code this:

DCOPRef dcop_ref = DCOPRef( "kpowersave", "KPowersaveIface" );
DCOPReply reply = dcop_ref.call("do_suspendToRAM()");
if ( !reply.isValid() ) {
  // error case
}
Comment 12 Dirk Mueller 2006-11-27 13:39:10 UTC
Holger: a) send() is "send and forget". if you want to wait for a reply, use call(). 

b) it tries to start the process if it isn't already there iirc. 
Comment 13 Holger Macht 2006-11-27 14:04:40 UTC
why does it return a boolean then and why isn't it documented in the class reference?

Well, can you (or any other kde developer) please fix this when you are looking at the kickoff stuff? You surely have better possibilities then me to test this all.
Comment 14 Stephan Kulow 2006-11-27 14:12:14 UTC
The function send() works very similar to call(), only that it returns a simple bool on whether the signal could be sent or not - the "send and forget" part is only implied by not having a way to retrieve the return value :)
Comment 15 Dirk Mueller 2006-11-27 20:58:55 UTC
it is too late for RC3, we'll try to implement and test it after GA. 
Comment 16 Holger Macht 2007-01-16 08:59:39 UTC
*** Bug 235124 has been marked as a duplicate of this bug. ***
Comment 17 Lubos Lunak 2007-02-16 17:37:50 UTC
*** Bug 246149 has been marked as a duplicate of this bug. ***
Comment 18 Will Stephenson 2007-03-30 18:12:34 UTC
liblazy uses send() instead of call() if passed a NULL DBusError, which we weren't doing.  Hopefully fixed in stable now.