From: Miloš Mulač Date: Fri, 27 Oct 2006 12:41:46 +0000 (+0000) Subject: - load intJobStatus even when no events arrived yet (embrio subjob with lost registra... X-Git-Tag: merge_connpool_dst~17 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=32d5601b8c4c8c952907d0ced8c7eaadecffbc96;p=jra1mw.git - load intJobStatus even when no events arrived yet (embrio subjob with lost registration event) - 2 memory corruptions removed --- diff --git a/org.glite.lb.server/src/jobstat.c b/org.glite.lb.server/src/jobstat.c index 4715d4f..8127fff 100644 --- a/org.glite.lb.server/src/jobstat.c +++ b/org.glite.lb.server/src/jobstat.c @@ -650,10 +650,10 @@ static char* hist_to_string(int * hist) assert(hist[0] == EDG_WLL_NUMBER_OF_STATCODES); - asprintf(&s, "%s=%d", edg_wll_StatToString(i), hist[1]); + asprintf(&s, "%s=%d", edg_wll_StatToString(1), hist[1]); for (i=1; icollectionState.state = EDG_WLL_JOB_RUNNING; event->collectionState.histogram = hist_to_string(pis->pub.children_hist); - event->collectionState.child = cis->pub.jobId; + edg_wlc_JobIdDup(cis->pub.jobId, &(event->collectionState.child)); event->collectionState.child_event = edg_wll_EventToString(ce->any.type); trans_db_store(ctx, NULL, event); @@ -824,7 +824,6 @@ edg_wll_ErrorCode edg_wll_StepIntState(edg_wll_Context ctx, edg_wll_JobStat *stat_out) { intJobStat *ijsp; - int intErr = 0; int flags = 0; int res; int be_strict = 0; @@ -835,10 +834,8 @@ edg_wll_ErrorCode edg_wll_StepIntState(edg_wll_Context ctx, memset(&oldstat,0,sizeof oldstat); - if (seq != 0) { - intErr = edg_wll_LoadIntState(ctx, job, seq - 1, &ijsp); - } - if (seq != 0 && !intErr) { + + 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); diff --git a/org.glite.lb.server/src/jobstat_supp.c b/org.glite.lb.server/src/jobstat_supp.c index 8da4349..694150c 100644 --- a/org.glite.lb.server/src/jobstat_supp.c +++ b/org.glite.lb.server/src/jobstat_supp.c @@ -547,7 +547,7 @@ static edg_wll_JobStat* dec_JobStat(char *in, char **rest) if (tmp_in != NULL) stat->possible_destinations = dec_strlist(tmp_in, &tmp_in); if (tmp_in != NULL) stat->possible_ce_nodes = dec_strlist(tmp_in, &tmp_in); if (tmp_in != NULL) { - stat->children_hist = (int*)calloc(EDG_WLL_NUMBER_OF_STATCODES, sizeof(int)); + stat->children_hist = (int*)calloc(EDG_WLL_NUMBER_OF_STATCODES+1, sizeof(int)); dec_int_array(tmp_in, &tmp_in, stat->children_hist); } *rest = tmp_in;