From d3f11674143c34a4c3d7c697880f70945a5256b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Mon, 30 Oct 2006 12:12:19 +0000 Subject: [PATCH] don't relay on histogram saved in intJobstat when reporting status --- org.glite.lb.server/src/jobstat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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'", -- 1.8.2.3