From 7f0bac4bd0f4389d5cbcab5f9ab80d6646db65b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Fri, 12 Aug 2011 12:07:34 +0000 Subject: [PATCH] Do not send out duplicate notifications when purging jobs that have already reached terminal state. --- org.glite.lb.server/src/notif_match.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.glite.lb.server/src/notif_match.c b/org.glite.lb.server/src/notif_match.c index b50c181..c98ecae 100644 --- a/org.glite.lb.server/src/notif_match.c +++ b/org.glite.lb.server/src/notif_match.c @@ -184,8 +184,9 @@ static int notif_match_conditions(edg_wll_Context ctx,const edg_wll_JobStat *old if (!cond) return 1; - if (!(flags & EDG_WLL_NOTIF_TERMINAL_STATES) || - ((flags & EDG_WLL_NOTIF_TERMINAL_STATES) && (EDG_WLL_JOB_TERMINAL_STATE[stat->state]))) { + if (!(flags & EDG_WLL_NOTIF_TERMINAL_STATES) || // Either there is no terminal flag + ((flags & EDG_WLL_NOTIF_TERMINAL_STATES) && (EDG_WLL_JOB_TERMINAL_STATE[stat->state]) && // Or the new state is terminal + ((stat->state!=EDG_WLL_JOB_PURGED) || !(EDG_WLL_JOB_TERMINAL_STATE[oldstat->state])))) { // And in case it is purged, it was not in a terminal state before if (parseJobQueryRec(ctx,cond,strlen(cond),&c)) { glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_ERROR, -- 1.8.2.3