.BI -G\fR,\fP --proxy-purge
Enable automatic purging of the jobs in terminal state for proxy service (disabled by default, purging cron job installed by YAIM).
+.TP
+.BI -E\fR,\fP --exclusive-zombies
+Check also purged jobs when registering a job with known JobID and the EDG_WLL_LOGLFLAG_EXCL flag set.
+
.\".SH USAGE
.\" Add any additional description here
static time_t rss_time = 60*60;
char * policy_file = NULL;
struct _edg_wll_authz_policy authz_policy = { NULL, 0};
+static int exclusive_zombies = 0;
{"proxy-purge", 0, NULL, 'G'},
{"rss-time", 1, NULL, 'I'},
{"policy", 1, NULL, 'l'},
+ {"exclusive-zombies", 0, NULL, 'E'},
{NULL,0,NULL,0}
};
-static const char *get_opt_string = "Ac:k:C:V:p:a:drm:ns:i:S:D:J:jR:F:xOL:N:X:Y:T:t:zb:gPBo:q:W:Z:GI:l:"
+static const char *get_opt_string = "Ac:k:C:V:p:a:drm:ns:i:S:D:J:jR:F:xOL:N:X:Y:T:t:zb:gPBo:q:W:Z:GI:l:E"
#ifdef GLITE_LB_SERVER_WITH_WS
"w:"
#endif
"\t-G,--proxy-purge\t enable automatic purge on proxy service (disabled by default)\n"
"\t-I,--rss-time\t age (in seconds) of job states published via RSS\n"
"\t-l,--policy\tauthorization policy file\n"
+ "\t-E,--exclusive-zombies\twith 'exclusive' flag, avoid reusing even zombified JobIDs\n"
,me);
}
break;
case 'l': policy_file = strdup(optarg);
break;
+ case 'E': exclusive_zombies = 1;
+ break;
case '?': usage(name); return 1;
}
}
ctx->strict_locking = strict_locking;
ctx->greyjobs = greyjobs;
+ ctx->exclusive_zombies = exclusive_zombies;
return 0;
}
{
char *unique = edg_wlc_JobIdGetUnique(event->any.jobId);
char *q = NULL, *userid = NULL, *subj = NULL, *owner = NULL;
- glite_lbu_Statement stmt = NULL;
+ glite_lbu_Statement stmt = NULL, stmt_zomb = NULL;
int nar, grey = 0;
char *can_peername = NULL;
int local_job = is_job_local(ctx, event->any.jobId);
if (nar < 0) goto err;
else if (nar == 0) {
/* Job not stored yet */
-
if (event->any.type == EDG_WLL_EVENT_REGJOB) {
/* XXX: directness is checked by any.user == peerName. Not perfect but better than event flags. */
goto err;
}
+ if ((event->any.priority & EDG_WLL_LOGLFLAG_EXCL) && ctx->exclusive_zombies) {
+ trio_asprintf(&q,"select jobid from zombie_jobs "
+ "where zombie_jobs.jobid='%|Ss'",unique);
+
+ if (edg_wll_ExecSQL(ctx,q,&stmt_zomb) > 0) {
+ edg_wll_SetError(ctx,EEXIST,"Zombie job with given jobid already exists. Rejecting event.");
+ goto err;
+ }
+ if (stmt_zomb) { glite_lbu_FreeStmt(&stmt_zomb); stmt_zomb = NULL; }
+ free (q); q = NULL;
+ }
+
/* else OK */
}
else {