From: Miloš Mulač Date: Mon, 30 Oct 2006 12:12:19 +0000 (+0000) Subject: don't relay on histogram saved in intJobstat when reporting status X-Git-Tag: merge_connpool_dst~13 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=d3f11674143c34a4c3d7c697880f70945a5256b0;p=jra1mw.git don't relay on histogram saved in intJobstat when reporting status --- diff --git a/org.glite.lb.server/src/jobstat.c b/org.glite.lb.server/src/jobstat.c index 50a8ed2..42b0747 100644 --- a/org.glite.lb.server/src/jobstat.c +++ b/org.glite.lb.server/src/jobstat.c @@ -167,12 +167,19 @@ int edg_wll_JobStatus( if (1) { char *out[2]; edg_wll_Stmt sh; - int num_sub, num_f; + int num_sub, num_f, i; if (stat->children_hist == NULL) { stat->children_hist = (int*) calloc(1+EDG_WLL_NUMBER_OF_STATCODES, sizeof(int)); stat->children_hist[0] = EDG_WLL_NUMBER_OF_STATCODES; } + else { + /* If hist is loaded, it probably contain only incomplete histogram + * builded in update_parent_status. Count it from scratch... + */ + for (i=1; i<=EDG_WLL_NUMBER_OF_STATCODES; i++) + stat->children_hist[i] = 0; + } if ((flags & EDG_WLL_STAT_CHILDREN) == 0) { trio_asprintf(&stmt, "SELECT status FROM states " "WHERE parent_job='%|Ss' AND version='%|Ss'",