Do not send out duplicate notifications when purging jobs that have already reached...
authorZdeněk Šustr <sustr4@cesnet.cz>
Fri, 12 Aug 2011 12:07:34 +0000 (12:07 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Fri, 12 Aug 2011 12:07:34 +0000 (12:07 +0000)
org.glite.lb.server/src/notif_match.c

index b50c181..c98ecae 100644 (file)
@@ -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,