static int con_queue = CON_QUEUE;
static char host[300];
static char * port;
+static time_t rss_time = 60*60;
{"con-queue", 1, NULL, 'q'},
{"proxy-il-sock", 1, NULL, 'W'},
{"proxy-il-fprefix", 1, NULL, 'Z'},
+ {"rss-time", 1, NULL, 'I'},
{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:"
+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:I:"
#ifdef GLITE_LB_SERVER_WITH_WS
"w:"
#endif
"\t-q,--con-queue\t size of the connection queue (accept)\n"
"\t-W,--proxy-il-sock\t socket to send events to\n"
"\t-Z,--proxy-il-fprefix\t file prefix for events\n"
+ "\t-I,--rss-time age\t (in seconds) of job states published via RSS\n"
,me);
}
break;
case 'Z': lbproxy_ilog_file_prefix = strdup(optarg);
break;
+ case 'I': sscanf(optarg, "%d", &rss_time);
+ break;
case '?': usage(name); return 1;
}
ctx->serverIdentity = strdup(server_subject);
+ ctx->rssTime = rss_time;
+
gettimeofday(&conn_start, 0);
h_errno = asyn_gethostbyaddr(&name, (char *)&a.sin_addr.s_addr,sizeof(a.sin_addr.s_addr), AF_INET, &dns_to);
return -1;
}
+ ctx->rssTime = rss_time;
return 0;
}
char *can_peername = edg_wll_gss_normalize_subj(ctx->peerName, 0);
if (strncmp(feedType, "finished", strlen("finished")) == 0){
- conds = malloc(3*sizeof(*conds));
+ conds = malloc(4*sizeof(*conds));
conds[0] = malloc(2*sizeof(**conds));
conds[0][0].attr = EDG_WLL_QUERY_ATTR_OWNER;
conds[0][0].op = EDG_WLL_QUERY_OP_EQUAL;
conds[1][2].op = EDG_WLL_QUERY_OP_EQUAL;
conds[1][2].value.i = EDG_WLL_JOB_CANCELLED;
conds[1][3].attr = EDG_WLL_QUERY_ATTR_UNDEF;
- conds[2] = NULL;
+ conds[2] = malloc(2*sizeof(**conds));
+ conds[2][0].attr = EDG_WLL_QUERY_ATTR_STATEENTERTIME;
+ conds[2][0].op = EDG_WLL_QUERY_OP_GREATER;
+ conds[2][0].value.t.tv_sec = time(NULL) - ctx->rssTime;
+ conds[2][0].value.t.tv_usec = 0;
+ conds[2][1].attr = EDG_WLL_QUERY_ATTR_UNDEF;
+ conds[3] = NULL;
}
else{
*statesOut = NULL;