From: Vincent Bernat Date: Tue, 24 Nov 2009 12:59:43 +0000 (+0000) Subject: Fix SMTP checker adding himself repeatedly in the list of failed checkers X-Git-Tag: v1.2.1~23 X-Git-Url: http://git.formilux.org/?a=commitdiff_plain;h=53a1e5c4be455bbe50761ec411e584ec76687046;p=people%2Falex%2Fkeepalived.git Fix SMTP checker adding himself repeatedly in the list of failed checkers When a SMTP check has already failed, SMTP checker will add itself again to the list of failed checks. For example, if the check fails 10 times in a row, the SMTP check will be present 10 times in the list of failed checks. This means that to be considered alive again, it should succeed 10 times. Other checkers just add themselves to the list of failed checkers only if they are not already present. We do the same here. --- diff --git a/keepalived/check/check_smtp.c b/keepalived/check/check_smtp.c index 29c55e8..edae298 100644 --- a/keepalived/check/check_smtp.c +++ b/keepalived/check/check_smtp.c @@ -329,10 +329,9 @@ smtp_final(thread *thread_obj, int error, const char *format, ...) smtp_buff[542 - 1] = '\0'; smtp_alert(chk->rs, NULL, NULL, "DOWN", smtp_buff); + update_svr_checker_state(DOWN, chk->id, chk->vs, chk->rs); } - update_svr_checker_state(DOWN, chk->id, chk->vs, chk->rs); - /* Reset everything back to the first host in the list */ smtp_chk->attempts = 0; smtp_chk->host_ctr = 0;