From: Alan T. DeKok Date: Sun, 28 Oct 2012 09:10:46 +0000 (+0100) Subject: Mark home server zombie only after response_window X-Git-Tag: release_3_0_0_beta1~1633 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e5f0e14fa259e6068e800db99f4ae69b336afb2;p=thirdparty%2Ffreeradius-server.git Mark home server zombie only after response_window When the "response_window" has been hit, THEN go mark the home server zombie. Not before. --- diff --git a/src/main/process.c b/src/main/process.c index 6019473d79e..f6ca886710c 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -2862,27 +2862,6 @@ STATE_MACHINE_DECL(proxy_wait_for_reply) break; case FR_ACTION_TIMER: - /* - * If we haven't received any packets for - * "response_window", then mark the home server - * as zombie. - * - * If the connection is TCP, then another - * "watchdog timer" function takes care of pings, - * etc. So we don't need to do it here. - * - * This check should really be part of a home - * server state machine. - */ - if (((home->state == HOME_STATE_ALIVE) || - (home->state == HOME_STATE_UNKNOWN)) && -#ifdef WITH_TCP - (home->proto != IPPROTO_TCP) && -#endif - ((home->last_packet_sent + home->response_window) <= now.tv_sec)) { - mark_home_server_zombie(home); - } - /* * Wake up "response_window" time in the future. * i.e. when MY packet hasn't received a response. @@ -2906,6 +2885,27 @@ STATE_MACHINE_DECL(proxy_wait_for_reply) RDEBUG("No proxy response, giving up on request and marking it done"); + /* + * If we haven't received any packets for + * "response_window", then mark the home server + * as zombie. + * + * If the connection is TCP, then another + * "watchdog timer" function takes care of pings, + * etc. So we don't need to do it here. + * + * This check should really be part of a home + * server state machine. + */ + if (((home->state == HOME_STATE_ALIVE) || + (home->state == HOME_STATE_UNKNOWN)) && +#ifdef WITH_TCP + (home->proto != IPPROTO_TCP) && +#endif + ((home->last_packet_recv + home->response_window) <= now.tv_sec)) { + mark_home_server_zombie(home); + } + FR_STATS_TYPE_INC(home->stats.total_timeouts); if (home->type == HOME_TYPE_AUTH) { if (request->proxy_listener) FR_STATS_TYPE_INC(request->proxy_listener->stats.total_timeouts);