]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Mark home server zombie only after response_window
authorAlan T. DeKok <aland@freeradius.org>
Sun, 28 Oct 2012 09:10:46 +0000 (10:10 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 28 Oct 2012 16:36:08 +0000 (17:36 +0100)
When the "response_window" has been hit, THEN go mark the home
server zombie.  Not before.

src/main/process.c

index 6019473d79ef4458a21c2a428725dab33aa61445..f6ca886710c1ad7e90e2e8422990b0a7b4a2e58f 100644 (file)
@@ -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);