diff --git a/Source/WPEFramework/PluginServer.cpp b/Source/WPEFramework/PluginServer.cpp index 90bd40ab47..85add752ba 100644 --- a/Source/WPEFramework/PluginServer.cpp +++ b/Source/WPEFramework/PluginServer.cpp @@ -739,7 +739,13 @@ namespace PluginHost { result = Core::ERROR_NONE; #endif if (result == Core::ERROR_NONE) { - SYSLOG(Logging::Startup, (_T("Hibernated plugin [%s]:[%s]"), ClassName().c_str(), Callsign().c_str())); + if (State() == IShell::state::HIBERNATED) { + SYSLOG(Logging::Startup, ("Hibernated plugin [%s]:[%s]", ClassName().c_str(), Callsign().c_str())); + } else { + // wakeup occured right after hibernation finished + SYSLOG(Logging::Startup, ("Hibernation aborted of plugin [%s]:[%s]", ClassName().c_str(), Callsign().c_str())); + result = Core::ERROR_ABORTED; + } } else if (State() == IShell::state::HIBERNATED) { State(IShell::ACTIVATED); @@ -857,13 +863,19 @@ namespace PluginHost { if (children.Count() > 0) { + // make sure to wakeup PIDs in opposite order to hibernation + // to quickly go over not hibernated PIDs and abort currently processed + std::list childrenBackward; while (children.Next()) { + childrenBackward.push_front(children.Current().Id()); + } + + for (auto iter = childrenBackward.begin(); iter != childrenBackward.end(); ++iter) { // Wakeup children of this process // There is no recovery path while doing Wakeup, don't care about errors - WakeupChildren(children.Current().Id(), timeout); - - TRACE(Activity, (_T("Wakeup of plugin [%s] child process [%u]"), Callsign().c_str(), children.Current().Id())); - result = WakeupProcess(timeout, children.Current().Id(), _administrator.Configuration().HibernateLocator().c_str(), _T(""), &_hibernateStorage); + WakeupChildren(*iter, timeout); + TRACE(Activity, (_T("Wakeup of plugin [%s] child process [%u]"), Callsign().c_str(), *iter)); + result = WakeupProcess(timeout, *iter, _administrator.Configuration().HibernateLocator().c_str(), _T(""), &_hibernateStorage); } }