stat = NULL;
if (!edg_wlc_JobIdParse(res[4], &jobid)) {
if ((stat = malloc(sizeof(intJobStat))) != NULL) {
- if (edg_wll_intJobStatus(ctx, jobid, 0, stat, 1)) {
+ if (edg_wll_intJobStatus(ctx, jobid, 0, stat, 1, 0)) {
free(stat);
stat = NULL;
}
} else {
lockErr = edg_wll_LockJob(ctx,job);
- intErr = edg_wll_intJobStatus(ctx, job, flags,&jobstat, js_enable_store && !lockErr);
+ intErr = edg_wll_intJobStatus(ctx, job, flags,&jobstat, js_enable_store && !lockErr, 0);
if (intErr) edg_wll_Error(ctx, NULL, &errdesc);
if (!lockErr) {
edg_wll_UnlockJob(ctx,job);
const edg_wlc_JobId job,
int flags,
intJobStat *intstat,
- int update_db)
+ int update_db,
+ int add_fqans)
{
/* Local variables */
if (!intErr) {
if (update_db) {
int tsq = num_events - 1;
+ if (add_fqans && tsq == 0 && ctx->fqans != NULL) {
+ for (i=0; ctx->fqans[i]; i++);
+ intstat->user_fqans = malloc(sizeof(*ctx->fqans)*(i+1));
+ for (i=0; ctx->fqans[i]; i++) {
+ intstat->user_fqans[i] = strdup(ctx->fqans[i]);
+ }
+ intstat->user_fqans[i] = NULL;
+ }
edg_wll_StoreIntState(ctx, intstat, tsq);
/* recheck
* intJobStat *reread;
/* TODO
edg_wll_UpdateStatistics(ctx, NULL, e, &jobstat.pub);
- if (ctx->rgma_export) write2rgma_status(&jobstat.pub);
+ if (ctx->rgma_export) write2rgma_status(&jobstat);
*/
#ifdef LB_BUF
edg_wll_CpyStatus(&ijsp->pub,&oldstat);
- if (ctx->rgma_export) oldstat_rgmaline = write2rgma_statline(&ijsp->pub);
+ if (ctx->rgma_export) oldstat_rgmaline = write2rgma_statline(ijsp);
res = processEvent(ijsp, e, seq, be_strict, &errstring);
if (res == RET_FATAL || res == RET_INTERNAL) { /* !strict */
edg_wll_UpdateStatistics(ctx,&oldstat,e,&ijsp->pub);
- if (ctx->rgma_export) write2rgma_chgstatus(&ijsp->pub, oldstat_rgmaline);
+ if (ctx->rgma_export) write2rgma_chgstatus(ijsp, oldstat_rgmaline);
if (stat_out) {
edg_wll_CpyStatus(&ijsp->pub, stat_out);
if (!edg_wll_LoadIntState(ctx, job, seq - 1, &ijsp)) {
edg_wll_CpyStatus(&ijsp->pub,&oldstat);
- if (ctx->rgma_export) oldstat_rgmaline = write2rgma_statline(&ijsp->pub);
+ if (ctx->rgma_export) oldstat_rgmaline = write2rgma_statline(ijsp);
res = processEvent(ijsp, e, seq, be_strict, &errstring);
if (res == RET_FATAL || res == RET_INTERNAL) { /* !strict */
return edg_wll_SetError(ctx, EINVAL, "update_parent_status()");
}
- if (ctx->rgma_export) write2rgma_chgstatus(&ijsp->pub, oldstat_rgmaline);
+ if (ctx->rgma_export) write2rgma_chgstatus(ijsp, oldstat_rgmaline);
if (stat_out) {
memcpy(stat_out,&ijsp->pub,sizeof *stat_out);
free(ijsp);
edg_wll_FreeStatus(&oldstat);
}
- else if (!edg_wll_intJobStatus(ctx, job, flags,&jobstat, js_enable_store))
+ else if (!edg_wll_intJobStatus(ctx, job, flags,&jobstat, js_enable_store, 1))
{
/* FIXME: we miss state change in the case of seq != 0
* Does anybody care? */
if (edg_wll_UnlockJob(ctx,job)) goto err;
edg_wll_UpdateStatistics(ctx,NULL,e,&jobstat.pub);
- if (ctx->rgma_export) write2rgma_status(&jobstat.pub);
+ if (ctx->rgma_export) write2rgma_status(&jobstat);
if (stat_out) {
memcpy(stat_out,&jobstat.pub,sizeof *stat_out);
* (includes edg_wll_JobStat API structure)
*/
-#define INTSTAT_VERSION "release-3.3.4"
+#define INTSTAT_VERSION "release-3.3.4+rgma_ui"
// Internal error codes
struct timeval last_pbs_event_timestamp;
int pbs_reruning; // true if rerun event arrived
+ char* *user_fqans;
/*!! if adding new field, modify also destroy_intJobStat_extension() */
} intJobStat;
edg_wll_ErrorCode edg_wll_IColumnsSQLPart(edg_wll_Context, void *, intJobStat *, int , char **, char **);
edg_wll_ErrorCode edg_wll_RefreshIColumns(edg_wll_Context, void *);
-int edg_wll_intJobStatus( edg_wll_Context, const edg_wlc_JobId, int, intJobStat *, int);
+int edg_wll_intJobStatus( edg_wll_Context, const edg_wlc_JobId, int, intJobStat *, int, int);
edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context, intJobStat *, int);
edg_wll_ErrorCode edg_wll_StoreIntStateEmbryonic(edg_wll_Context, edg_wlc_JobId, char *icnames, char *values, edg_wll_bufInsert *bi);
edg_wll_ErrorCode edg_wll_LoadIntState(edg_wll_Context , edg_wlc_JobId , int, intJobStat **);
intJobStat* dec_intJobStat(char *, char **);
char *enc_intJobStat(char *, intJobStat* );
-void write2rgma_status(edg_wll_JobStat *);
-void write2rgma_chgstatus(edg_wll_JobStat *, char *);
-char* write2rgma_statline(edg_wll_JobStat *);
+void write2rgma_status(intJobStat *);
+void write2rgma_chgstatus(intJobStat *, char *);
+char* write2rgma_statline(intJobStat *);
int before_deep_resubmission(const char *, const char *);
int same_branch(const char *, const char *);
if (ret) ret = enc_strlist(ret, stat->possible_ce_nodes);
if (ret) ret = enc_int(ret, stat->suspended);
if (ret) ret = enc_string(ret, stat->suspend_reason);
+ if (ret) ret = enc_string(ret, stat->failure_reasons);
+ if (ret) ret = enc_string(ret, stat->ui_host);
if (ret) ret = enc_int_array(ret, stat->children_hist, EDG_WLL_NUMBER_OF_STATCODES);
if (ret) ret = enc_string(ret, stat->pbs_state);
if (ret) ret = enc_string(ret, stat->pbs_queue);
if (tmp_in != NULL) stat->possible_ce_nodes = dec_strlist(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->suspended = dec_int(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->suspend_reason = dec_string(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->failure_reasons = dec_string(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->ui_host = dec_string(tmp_in, &tmp_in);
if (tmp_in != NULL) {
stat->children_hist = (int*)calloc(EDG_WLL_NUMBER_OF_STATCODES+1, sizeof(int));
dec_int_array(tmp_in, &tmp_in, stat->children_hist);
if (ret) ret = enc_branch_states(ret, stat->branch_states);
if (ret) ret = enc_timeval(ret, stat->last_pbs_event_timestamp);
if (ret) ret = enc_int(ret, stat->pbs_reruning);
+ if (ret) ret = enc_strlist(ret, stat->user_fqans);
return ret;
}
if (tmp_in != NULL) {
stat->pbs_reruning = dec_int(tmp_in, &tmp_in);
}
+ if (tmp_in != NULL) {
+ stat->user_fqans = dec_strlist(tmp_in, &tmp_in);
+ }
} else if (tmp_in != NULL) {
edg_wll_FreeStatus(pubstat);
free(pubstat);
if (USABLE_DATA(res, strict)) {
switch (e->accepted.source) {
case EDG_WLL_SOURCE_NETWORK_SERVER:
+ rep(js->pub.ui_host, e->accepted.from_host);
break; /* no WM id */
case EDG_WLL_SOURCE_LOG_MONITOR:
rep(js->pub.condorId, e->accepted.local_jobid); break;
void destroy_intJobStat_extension(intJobStat *p)
{
+ int i;
+
if (p->last_seqcode) free(p->last_seqcode);
if (p->last_cancel_seqcode) free(p->last_cancel_seqcode);
if (p->branch_tag_seqcode) free(p->branch_tag_seqcode);
if (p->last_branch_seqcode) free(p->last_branch_seqcode);
if (p->deep_resubmit_seqcode) free(p->deep_resubmit_seqcode);
free_branch_state(&p->branch_states);
+ if (p->user_fqans != NULL ) {
+ for (i=0; p->user_fqans[i]; i++)
+ free(p->user_fqans[i]);
+ free(p->user_fqans);
+ }
+
memset(p,0,sizeof(*p));
}
return;
}
+static char* format_strlist(char **list, char sep)
+{
+ char *a, *b;
+ int i;
+
+ if (list && list[0]) {
+ a = strdup(list[0]);
+ for (i = 1; list[i]; i++) {
+ b = NULL;
+ trio_asprintf(&b,"%s%c%s",a,sep,list[i]);
+ free(a);
+ if (!b) { return strdup(""); }
+ a = b;
+ }
+ return a;
+ } else {
+ return strdup("");
+ }
+}
-char* write2rgma_statline(edg_wll_JobStat *stat)
+char* write2rgma_statline(intJobStat *intstat)
{
+ edg_wll_JobStat *stat = &intstat->pub;
char *stmt = NULL;
char *string_jobid, *string_stat, *string_server;
char *string_vo = NULL;
+ char *string_fqans = NULL;
string_jobid = edg_wlc_JobIdUnparse(stat->jobId);
string_stat = edg_wll_StatToString(stat->state);
string_server = edg_wlc_JobIdGetServer(stat->jobId);
+ string_fqans = format_strlist(intstat->user_fqans, '|');
if (stat->jdl != NULL) {
struct cclassad *ad;
"DESTINATION=%|Ss "
"EXITCODE=%d "
"DONECODE=%d "
+ "UIHOST=%s "
+ "VOMS=%s "
"STATUSREASON=%|Ss"
"\n",
string_jobid,
(stat->destination) ? (stat->destination) : "",
stat->exit_code,
stat->done_code,
+ (stat->ui_host) ? (stat->ui_host) : "",
+ string_fqans ? string_fqans : "",
(stat->reason) ? (stat->reason) : ""
);
free(string_jobid);
free(string_stat);
free(string_server);
+ free(string_fqans);
return stmt;
}
-void write2rgma_status(edg_wll_JobStat *stat)
+void write2rgma_status(intJobStat *intstat)
{
char *line;
int lcgmon = 0;
if (rgma_fd < -1) return;
- line = write2rgma_statline(stat);
+ line = write2rgma_statline(intstat);
if (line) {
if (getenv("GLITE_WMS_LCGMON_FILE")) lcgmon = 1;
write2rgma_line(line, !lcgmon);
/* Export status record only if new status line is different from
previous one. free() prev_statline parameter. */
-void write2rgma_chgstatus(edg_wll_JobStat *stat, char *prev_statline)
+void write2rgma_chgstatus(intJobStat *intstat, char *prev_statline)
{
char *line;
int lcgmon = 0;
if (rgma_fd < -1) return;
- line = write2rgma_statline(stat);
+ line = write2rgma_statline(intstat);
if (line && (!prev_statline || strcmp(line, prev_statline))) {
if (getenv("GLITE_WMS_LCGMON_FILE")) lcgmon = 1;
write2rgma_line(line, !lcgmon);