From: Zdeněk Šustr Date: Thu, 19 Mar 2009 16:41:38 +0000 (+0000) Subject: Modified handling of state-dependent timeouts. Matches existing tests and documentation. X-Git-Tag: merge_313_6_dst~6 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=a824c05337b258163b0185d8ee873a458428d9a6;p=jra1mw.git Modified handling of state-dependent timeouts. Matches existing tests and documentation. --- diff --git a/org.glite.lb.server/src/srv_purge.c b/org.glite.lb.server/src/srv_purge.c index ddc2847..49c47dd 100644 --- a/org.glite.lb.server/src/srv_purge.c +++ b/org.glite.lb.server/src/srv_purge.c @@ -292,11 +292,14 @@ int edg_wll_PurgeServer(edg_wll_Context ctx,const edg_wll_PurgeRequest *request, start = time(NULL); for (i=0; itimeout[i] < 0 ? - ( request->timeout[EDG_WLL_PURGE_JOBSTAT_OTHER] < 0 ? - ctx->purge_timeout[i] : - request->timeout[EDG_WLL_PURGE_JOBSTAT_OTHER] ) : - request->timeout[i]; + if (request->timeout[i] < 0) { // no specific timeout + if (request->timeout[i] == -2) //no purge + timeout[i] = request->timeout[i]; + else {// use server default + timeout[i] = ctx->purge_timeout[i]; + } + } + else timeout[i] = request->timeout[i]; //specific given if ((jobs_to_exa = edg_wll_ExecSQL(ctx, (ctx->isProxy) ? "select dg_jobid from jobs where proxy='1'" : "select dg_jobid from jobs where server='1'", &s)) < 0) goto abort; @@ -329,7 +332,7 @@ int edg_wll_PurgeServer(edg_wll_Context ctx,const edg_wll_PurgeRequest *request, goto abort; } - if (stat.lastUpdateTime.tv_sec && start-stat.lastUpdateTime.tv_sec > timeout[stat.state] && !check_strict_jobid(ctx,job)) + if (timeout[stat.state] >=0 && stat.lastUpdateTime.tv_sec && start-stat.lastUpdateTime.tv_sec > timeout[stat.state] && !check_strict_jobid(ctx,job)) { if (purge_one(ctx,job,dumpfile,request->flags&EDG_WLL_PURGE_REALLY_PURGE,ctx->isProxy)) { edg_wll_FreeStatus(&stat);