MGR: IsBOINCCoreRunning() tests whether Client process exists, not by doing an RPC which hangs Manager if Client is running but unresponsive

svn path=/trunk/boinc/; revision=18116
This commit is contained in:
Charlie Fenton 2009-05-15 09:07:32 +00:00
parent 34ccf3057d
commit d758dd78b6
2 changed files with 17 additions and 32 deletions

View File

@ -4513,12 +4513,6 @@ Charlie 13 May 2009
clientgui/
AsyncRPC.cpp
Charlie 14 May 2009
- MGR: Update m_dtCachedCCStatusTimestamp only when RPC completes.
clientgui/
MainDocument.cpp
David 14 May 2009
- scheduler: add <report_max> config parameter;
limits the # of completed results handled per scheduler RPC.
@ -4567,7 +4561,6 @@ Charlie 15 May 2009
BOINCWizards.h
CompletionPage.cpp
Events.h
MainDocument.cpp
Makefile.am
sg_BoincSimpleGUI.cpp
sg_ProjectsComponent.cpp
@ -4580,3 +4573,16 @@ Charlie 15 May 2009
project.pbxproj
win_build/
boincmgr.vcproj
Charlie 15 May 2009
- MGR: Update m_dtCachedCCStatusTimestamp only when RPC completes.
- MGR: CBOINCClientManager::IsBOINCCoreRunning() tests whether the Client
process exists, rather than doing an RPC. We can't use an async RPC
here because we may not yet be connected to the Client, and the direct
RPC which was being done would hang the Manager if the Client was
running but not responding. This should fix some of the situations
where the manager would become unresponsive.
clientgui/
BOINCClientManager.cpp
MainDocument.cpp

View File

@ -110,11 +110,11 @@ int CBOINCClientManager::IsBOINCConfiguredAsDaemon() {
bool CBOINCClientManager::IsBOINCCoreRunning() {
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCClientManager::IsBOINCCoreRunning - Function Begin"));
int retval=0;
bool running = false;
RPC_CLIENT rpc;
#ifdef __WXMSW__
DWORD dwExitCode = 0;
if (IsBOINCServiceInstalled()) {
running = (FALSE != IsBOINCServiceStarting()) || (FALSE != IsBOINCServiceRunning());
} else {
@ -123,35 +123,14 @@ bool CBOINCClientManager::IsBOINCCoreRunning() {
running = (STILL_ACTIVE == dwExitCode);
}
}
}
#else
if (m_lBOINCCoreProcessId != 0) {
running = ProcessExists(m_lBOINCCoreProcessId);
}
#endif
#if 0
// If set up to run as a daemon, allow time for daemon to start up
for (int i=0; i<10; i++) {
retval = rpc.init("localhost"); // synchronous is OK since local
wxLogTrace(wxT("Function Status"), wxT("CBOINCClientManager::IsBOINCCoreRunning - Connecting to core client returned '%d'"), retval);
retval = rpc.authorize(""); // Do not use an RPC that uses the SET_LOCALE class, this
// function is typically called from the UI thread. If the
// UI thread and the async thread happen to use SET_LOCALE
// at the same time there is a 50% chance that the UI will
// be partially suck using the "C" locale which is needed to
// parse the data coming back from the CC.
wxLogTrace(wxT("Function Status"), wxT("CBOINCClientManager::IsBOINCCoreRunning - Requesting host info... retval '%d'"), retval);
running = (retval != ERR_CONNECT);
rpc.close();
if (running) break;
if (!IsBOINCConfiguredAsDaemon()) break;
wxSleep(1);
}
#endif
#ifdef __WXMSW__
}
#endif
wxLogTrace(wxT("Function Status"), wxT("CBOINCClientManager::IsBOINCCoreRunning - Returning '%d'"), retval);
wxLogTrace(wxT("Function Status"), wxT("CBOINCClientManager::IsBOINCCoreRunning - Returning '%d'"), (int)running);
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCClientManager::IsBOINCCoreRunning - Function End"));
return running;
}