2000-01-22 12:49:49 +00:00
|
|
|
/* GSWLoadBalancing.c - GSWeb: Adaptors: Load Balancing
|
2004-12-27 16:33:24 +00:00
|
|
|
Copyright (C) 1999, 2000, 2003-2004 Free Software Foundation, Inc.
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
2003-02-28 18:37:43 +00:00
|
|
|
Date: July 1999
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
This file is part of the GNUstep Web Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "GSWUtil.h"
|
2004-12-27 16:33:24 +00:00
|
|
|
#include "GSWStats.h"
|
2000-01-22 12:49:49 +00:00
|
|
|
#include "GSWDict.h"
|
|
|
|
#include "GSWList.h"
|
2000-03-16 16:16:49 +00:00
|
|
|
#include "GSWString.h"
|
2000-01-22 12:49:49 +00:00
|
|
|
#include "GSWURLUtil.h"
|
|
|
|
#include "GSWConfig.h"
|
|
|
|
#include "GSWAppRequestStruct.h"
|
|
|
|
#include "GSWAppConnect.h"
|
|
|
|
#include "GSWHTTPRequest.h"
|
|
|
|
#include "GSWHTTPResponse.h"
|
|
|
|
#include "GSWAppRequest.h"
|
|
|
|
#include "GSWHTTPHeaders.h"
|
|
|
|
#include "GSWLoadBalancing.h"
|
|
|
|
#include "GSWLock.h"
|
2001-10-25 Manuel Guesdon <mguesdon@orange-concept.com>
Applied patch from Turbocat (www.turbocat.de): GSWPatch_04-JUL_2001.diff
except GSWeb.framework/GSWInput.m/.h one (have to verify coherence of it)
* GSWAdaptors/common/GSWApp.c/.h: Added GSWAppInfo
* GSWAdaptors/common/GSWAppConnectNSSocket.c: Changes on includes
* GSWAdaptors/common/GSWLoadBalancing.h: Added parameter to GSWLoadBalancing_Find*
* GSWAdaptors/common/GSWLoadBalancing.c: added p_pURLComponents parameter,
o management of AppInfo
* GSWAdaptors/common/GSWAppRequest.c: managing refused connections
* GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd: misspelling correction
* GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.html: Various Changes
* GSWExtensions.framework/GSWStatsPage.m: changes in login/password validation
o -awake added
* GSWeb.framework/GSWApplication.m/.h: Manage refusing new sessions
* GSWeb.framework/GSWBundle.m: debug traces commented
* GSWeb.framework/GSWComponent.m: implementation of ensureAwakeInContext:
* GSWeb.framework/GSWAssociation.m: special case for returned value of type GSMutableArray (Why ?)
* GSWeb.framework/GSWComponentRequestHandler.m: comments added
* GSWeb.framework/GSWDefaultAdaptorThread.m: added debug traces
* GSWeb.framework/GSWDirectActionRequestHandler.m: replaced GSWDirectAction by DirectAction
* GSWeb.framework/GSWDisplayGroup.m: initialize _baseIndex,
o correct misspelled names,
o added -description,
o use delegate in _changedInEditingContext:, _invalidatedAllObjectsInStore:,
o changes in -deleteObjectAtIndex:,
* GSWeb.framework/GSWFileUpload.m: different handling of _fileDatasCount,
handle bug in omniweb-browser
* GSWeb.framework/GSWHyperlink.m: added ensureAwakeInContext: call
* GSWeb.framework/GSWImageButton.m: added ensureAwakeInContext: call
* GSWeb.framework/GSWPopUpButton.m:
o use [response_ appendContentString:_noSelectionStringValue] instead of
[response_ appendContentHTMLString:_noSelectionStringValue]
o handle no displayString case
o use [response_ appendContentString:_displayStringValue] instead of
[response_ appendContentHTMLString:_displayStringValue]
* GSWeb.framework/GSWConfig.h: set GSWOPTVALUE_AutoOpenInBrowser to NO
* GSWeb.framework/GSWElementIDString.m: comment some debug traces
* GSWeb.framework/GSWHTMLStaticGroup.m/.h: added support of documentType
* GSWeb.framework/GSWHTMLURLValuedElement.m: addeded debug trace
* GSWeb.framework/GSWKeyValueAssociation.m: use NSStringFromClass([retValue class])
instead of [retValue class] for log
* GSWeb.framework/GSWRequest.m/.h: added -(NSDictionary*)headers;
o added test on _contentType in _contentType
o autorelease _dict in -uriElements
* GSWeb.framework/GSWResponse.m/.h: added -setHeaders: and -headers
o Added GSWResponse (GSWResponseRefused)
o return self in -generateResponse
* GSWeb.framework/GSWServerSessionStore.m/.h: added @interface GSWServerSessionStore (GSWServerSessionStoreInfo)
o added refusing session management
* GSWeb.framework/GSWSession.m:
o in -terminate forces to call removeSessionWithID in GSWServerSessionStore to dealloc it
* GSWeb.framework/GSWSessionTimeOutManager.m/.h: replace NSMutableOrderedArray* sessionOrderedTimeOuts;
by NSMutableArray* sessionOrderedTimeOuts;
o added traces
o added GSWSessionTimeOutManager (GSWSessionRefused)
* GSWeb.framework/GSWSubmitButton.m: raise exception if no element is returned
* GSWeb.framework/GSWTemplateParser.m: added doctype management
* GSWeb.framework/GSWUtils.h: added if defined for __NetBSD__
* GSWeb.framework/GSWWOCompatibility.m/.h: added WOGenericContainer, WOImageButton, WOHyperlink
* GSWeb.framework/attach.m: added if defined for __NetBSD__
* GSWeb.framework/stacktrace.m: added if defined for __NetBSD__
* GSWeb.framework/GSWTemplateParserXML.m: traces commented
o test XML node content before adding it
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m
o changes in -getIVarNamed: and in setIVarNamed:withValue: (use of sel+imp, tests on parameters)
* GSWAdaptors/common/GSWHTTPResponse.c: change in GSWHTTPResponse_GetResponse()
o debug traces removed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@11251 72102866-910b-0410-8b05-ffd578937521
2001-10-26 08:50:52 +00:00
|
|
|
#include "GSWApp.h"
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-02-28 18:37:43 +00:00
|
|
|
BOOL
|
|
|
|
GSWLoadBalancing_FindApp(GSWAppRequest *p_pAppRequest,
|
|
|
|
void *p_pLogServerData,
|
|
|
|
GSWURLComponents *p_pURLComponents)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
BOOL fFound=FALSE;
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWApp *pApp=NULL;
|
2004-12-27 16:33:24 +00:00
|
|
|
|
|
|
|
GSWDebugLog(p_pLogServerData,"LoadBalancing: Start GSWLoadBalancing_FindApp");
|
|
|
|
GSWDebugLog(p_pLogServerData,"LoadBalancing: looking for %s",
|
|
|
|
p_pAppRequest->pszName);
|
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
GSWConfig_LoadConfiguration(p_pLogServerData);
|
2004-12-27 16:33:24 +00:00
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLock_Lock(g_lockAppList);
|
2004-12-27 16:33:24 +00:00
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
pApp = GSWConfig_GetApp(p_pAppRequest->pszName);
|
2000-01-22 12:49:49 +00:00
|
|
|
if (pApp)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
GSWList *pInstancesList=GSWDict_AllKeys(&pApp->stInstancesDict);
|
|
|
|
unsigned int uInstancesCount=GSWList_Count(pInstancesList);
|
|
|
|
int iTries=uInstancesCount;
|
|
|
|
GSWAppInstance *pAppInstance=NULL;
|
|
|
|
time_t curTime = (time_t)0;
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-02-28 18:37:43 +00:00
|
|
|
while (!fFound && iTries-->0)
|
|
|
|
{
|
2003-04-09 17:12:00 +00:00
|
|
|
pApp->iLastInstanceIndex = (pApp->iLastInstanceIndex+1) % uInstancesCount;
|
2004-12-27 16:33:24 +00:00
|
|
|
GSWDebugLog(p_pLogServerData,"LoadBalancing: Will try instance %d (instances count=%d).",
|
2003-04-09 17:12:00 +00:00
|
|
|
pApp->iLastInstanceIndex,uInstancesCount);
|
2003-02-28 18:37:43 +00:00
|
|
|
pAppInstance =
|
|
|
|
(GSWAppInstance *)GSWDict_ValueForKey(&pApp->stInstancesDict,
|
2003-04-09 17:12:00 +00:00
|
|
|
GSWList_ElementAtIndex(pInstancesList,
|
|
|
|
pApp->iLastInstanceIndex));
|
2003-02-28 18:37:43 +00:00
|
|
|
if (pAppInstance)
|
|
|
|
{
|
|
|
|
if (!pAppInstance->pApp)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWLog(GSW_CRITICAL,p_pLogServerData,
|
|
|
|
"AppInstance pApp is null pAppInstance=%p",
|
|
|
|
pAppInstance);
|
|
|
|
};
|
|
|
|
if (pAppInstance->timeNextRetryTime!=0)
|
|
|
|
{
|
|
|
|
if (!curTime)
|
|
|
|
time(&curTime);
|
|
|
|
if (pAppInstance->timeNextRetryTime<curTime)
|
|
|
|
{
|
2003-04-09 17:12:00 +00:00
|
|
|
GSWLog(GSW_WARNING,
|
2003-02-28 18:37:43 +00:00
|
|
|
p_pLogServerData,
|
2003-04-09 17:12:00 +00:00
|
|
|
"LoadBalance: Instance %s:%d was marked dead for %d secs. Now resurecting !",
|
2003-02-28 18:37:43 +00:00
|
|
|
p_pAppRequest->pszName,
|
|
|
|
pAppInstance->iInstance,
|
|
|
|
APP_CONNECT_RETRY_DELAY);
|
|
|
|
pAppInstance->timeNextRetryTime=0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (pAppInstance->timeNextRetryTime==0 && pAppInstance->fValid)
|
|
|
|
{
|
|
|
|
BOOL okay = TRUE;
|
|
|
|
// check if refused, time to try again ?
|
|
|
|
if (p_pURLComponents->stRequestHandlerKey.iLength==0 ||
|
|
|
|
p_pURLComponents->stRequestHandlerKey.pszStart==NULL)
|
|
|
|
{
|
|
|
|
GSWAppInfo *thisAppInfo =
|
|
|
|
GSWAppInfo_Find(p_pAppRequest->pszName,
|
|
|
|
pAppInstance->iInstance);
|
|
|
|
if (thisAppInfo && thisAppInfo->isRefused)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
time_t actTime = (time_t)0;
|
|
|
|
// this instance refuses new sessions
|
|
|
|
time(&actTime);
|
|
|
|
if (actTime > thisAppInfo->timeNextRetryTime)
|
|
|
|
{
|
|
|
|
thisAppInfo->isRefused = FALSE; // try it again
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
okay = FALSE; // try an other instance
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (okay == TRUE)
|
|
|
|
{
|
|
|
|
fFound = TRUE;
|
|
|
|
strcpy(p_pAppRequest->pszName,pApp->pszName);
|
|
|
|
p_pAppRequest->iInstance = pAppInstance->iInstance;
|
|
|
|
p_pAppRequest->pszHost = pAppInstance->pszHostName;
|
|
|
|
p_pAppRequest->iPort = pAppInstance->iPort;
|
|
|
|
p_pAppRequest->eType = EAppType_LoadBalanced;
|
|
|
|
p_pAppRequest->pAppInstance = pAppInstance;
|
|
|
|
pAppInstance->uOpenedRequestsNb++;
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
2003-02-28 18:37:43 +00:00
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWList_Free(pInstancesList,FALSE);
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLock_Unlock(g_lockAppList);
|
2003-04-09 17:12:00 +00:00
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
if (fFound)
|
2004-12-27 16:33:24 +00:00
|
|
|
{
|
|
|
|
GSWDebugLog(p_pLogServerData,
|
|
|
|
"LoadBalance: looking for %s, found instance %d on %s:%d",
|
|
|
|
p_pAppRequest->pszName,
|
|
|
|
p_pAppRequest->iInstance,
|
|
|
|
p_pAppRequest->pszHost,
|
|
|
|
p_pAppRequest->iPort);
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
else
|
2004-12-27 16:33:24 +00:00
|
|
|
{
|
|
|
|
GSWDebugLog(p_pLogServerData,"LoadBalance: looking for %s, Not Found",
|
|
|
|
p_pAppRequest->pszName);
|
|
|
|
};
|
|
|
|
GSWDebugLog(p_pLogServerData,"Stop GSWLoadBalancing_FindApp");
|
2000-01-22 12:49:49 +00:00
|
|
|
return fFound;
|
|
|
|
};
|
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-02-28 18:37:43 +00:00
|
|
|
BOOL
|
|
|
|
GSWLoadBalancing_FindInstance(GSWAppRequest *p_pAppRequest,
|
|
|
|
void *p_pLogServerData,
|
|
|
|
GSWURLComponents *p_pURLComponents)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
BOOL fFound=FALSE;
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWApp *pApp=NULL;
|
2000-01-22 12:49:49 +00:00
|
|
|
int i=0;
|
2004-12-27 16:33:24 +00:00
|
|
|
|
|
|
|
GSWDebugLog(p_pLogServerData,"Start GSWLoadBalancing_FindInstance");
|
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
GSWConfig_LoadConfiguration(p_pLogServerData);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLock_Lock(g_lockAppList);
|
2004-12-27 16:33:24 +00:00
|
|
|
|
2003-02-28 18:37:43 +00:00
|
|
|
pApp = (GSWApp *)GSWConfig_GetApp(p_pAppRequest->pszName);
|
2000-01-22 12:49:49 +00:00
|
|
|
if (pApp)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
GSWAppInstance *pAppInstance=NULL;
|
|
|
|
char szInstanceNum[50]="";
|
|
|
|
sprintf(szInstanceNum,"%d",p_pAppRequest->iInstance);
|
|
|
|
pAppInstance =
|
|
|
|
(GSWAppInstance *)GSWDict_ValueForKey(&pApp->stInstancesDict,
|
|
|
|
szInstanceNum);
|
2003-11-24 08:58:20 +00:00
|
|
|
|
|
|
|
// Not a known instance
|
|
|
|
if (!pAppInstance)
|
|
|
|
{
|
|
|
|
// but we can switch to a known one ?
|
|
|
|
if (pApp->fSwitchToKnownInstance)
|
|
|
|
fFound=GSWLoadBalancing_FindApp(p_pAppRequest,
|
|
|
|
p_pLogServerData,
|
|
|
|
p_pURLComponents);
|
|
|
|
}
|
|
|
|
else
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2004-12-27 16:33:24 +00:00
|
|
|
GSWDebugLog(p_pLogServerData,"Instance Found");
|
2003-02-28 18:37:43 +00:00
|
|
|
if (pAppInstance->fValid)
|
|
|
|
{
|
|
|
|
BOOL okay = TRUE;
|
|
|
|
// check if refused, time to try again ?
|
|
|
|
if (p_pURLComponents->stRequestHandlerKey.iLength==0 ||
|
|
|
|
p_pURLComponents->stRequestHandlerKey.pszStart==NULL)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWAppInfo *thisAppInfo =
|
|
|
|
GSWAppInfo_Find(p_pAppRequest->pszName,
|
|
|
|
pAppInstance->iInstance);
|
|
|
|
if (thisAppInfo && thisAppInfo->isRefused)
|
|
|
|
{
|
|
|
|
time_t actTime = (time_t)0;
|
|
|
|
// this instance refuses new sessions
|
|
|
|
time(&actTime);
|
|
|
|
if (actTime > thisAppInfo->timeNextRetryTime)
|
2000-03-20 15:50:51 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
thisAppInfo->isRefused = FALSE; // try it again
|
2000-03-20 15:50:51 +00:00
|
|
|
}
|
2003-02-28 18:37:43 +00:00
|
|
|
else
|
2000-03-20 15:50:51 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
okay = FALSE; // try an other instance
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (okay == TRUE)
|
|
|
|
{
|
|
|
|
fFound=TRUE;
|
|
|
|
p_pAppRequest->iInstance = pAppInstance->iInstance;
|
|
|
|
p_pAppRequest->pszHost = pAppInstance->pszHostName;
|
|
|
|
p_pAppRequest->iPort = pAppInstance->iPort;
|
|
|
|
p_pAppRequest->eType = EAppType_LoadBalanced;
|
|
|
|
p_pAppRequest->pAppInstance = pAppInstance;
|
|
|
|
pAppInstance->uOpenedRequestsNb++;
|
2004-12-27 16:33:24 +00:00
|
|
|
GSWDebugLog(p_pLogServerData,"Instance is valid");
|
2003-02-28 18:37:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-12-27 16:33:24 +00:00
|
|
|
GSWDebugLog(p_pLogServerData,"Instance is not valid");
|
2003-02-28 18:37:43 +00:00
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
2003-02-28 18:37:43 +00:00
|
|
|
};
|
2004-12-27 16:33:24 +00:00
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLock_Unlock(g_lockAppList);
|
2004-12-27 16:33:24 +00:00
|
|
|
|
|
|
|
GSWDebugLog(p_pLogServerData,"Stop GSWLoadBalancing_FindInstance");
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
return fFound;
|
|
|
|
};
|
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-02-28 18:37:43 +00:00
|
|
|
void
|
|
|
|
GSWLoadBalancing_MarkNotRespondingApp(GSWAppRequest *p_pAppRequest,
|
|
|
|
void *p_pLogServerData)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWAppInstance *pAppInstance;
|
2000-01-22 12:49:49 +00:00
|
|
|
time_t now;
|
|
|
|
time(&now);
|
2003-02-28 18:37:43 +00:00
|
|
|
pAppInstance = p_pAppRequest->pAppInstance;
|
2000-01-22 12:49:49 +00:00
|
|
|
pAppInstance->uOpenedRequestsNb--;
|
2003-04-09 17:12:00 +00:00
|
|
|
pAppInstance->uNotRespondingRequestsNb++;
|
2000-01-22 12:49:49 +00:00
|
|
|
pAppInstance->timeNextRetryTime=now+APP_CONNECT_RETRY_DELAY;
|
2003-04-09 17:12:00 +00:00
|
|
|
GSWLog(GSW_WARNING,p_pLogServerData,
|
|
|
|
"Marking %s unresponsive for %d s. notResonding count: %u handled count: %u",
|
|
|
|
p_pAppRequest->pszName,(int)APP_CONNECT_RETRY_DELAY,
|
|
|
|
pAppInstance->uNotRespondingRequestsNb,
|
|
|
|
pAppInstance->uHandledRequestsNb);
|
2004-12-27 16:33:24 +00:00
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
if (!pAppInstance->fValid)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
if (GSWAppInstance_FreeIFND(pAppInstance))
|
|
|
|
pAppInstance=NULL;
|
|
|
|
};
|
2000-03-16 16:16:49 +00:00
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-02-28 18:37:43 +00:00
|
|
|
void
|
|
|
|
GSWLoadBalancing_StartAppRequest(GSWAppRequest *p_pAppRequest,
|
|
|
|
void *p_pLogServerData)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWAppInstance *pAppInstance=p_pAppRequest->pAppInstance;
|
2000-01-22 12:49:49 +00:00
|
|
|
if (pAppInstance->timeNextRetryTime!=0)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
pAppInstance->timeNextRetryTime=0;
|
|
|
|
GSWLog(GSW_WARNING,p_pLogServerData,
|
|
|
|
"Marking %s as alive",p_pAppRequest->pszName);
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
}
|
|
|
|
|
2000-03-16 16:16:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-02-28 18:37:43 +00:00
|
|
|
void
|
|
|
|
GSWLoadBalancing_StopAppRequest(GSWAppRequest *p_pAppRequest,
|
|
|
|
void *p_pLogServerData)
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-02-28 18:37:43 +00:00
|
|
|
GSWAppInstance *pAppInstance=p_pAppRequest->pAppInstance;
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLock_Lock(g_lockAppList);
|
|
|
|
pAppInstance->uOpenedRequestsNb--;
|
2003-04-09 17:12:00 +00:00
|
|
|
pAppInstance->uHandledRequestsNb++;
|
2000-03-16 16:16:49 +00:00
|
|
|
if (!pAppInstance->fValid)
|
2003-02-28 18:37:43 +00:00
|
|
|
{
|
|
|
|
if (GSWAppInstance_FreeIFND(pAppInstance))
|
|
|
|
pAppInstance=NULL;
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLock_Unlock(g_lockAppList);
|
2000-03-16 16:16:49 +00:00
|
|
|
p_pAppRequest->pAppInstance = NULL;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|