]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
mark the message "done" if we didn't send it to the worker
authorAlan T. DeKok <aland@freeradius.org>
Tue, 18 Aug 2020 13:11:35 +0000 (09:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 18 Aug 2020 13:11:35 +0000 (09:11 -0400)
src/lib/io/network.c

index 7276606e697f7de5309ffcdd905fe30214eb77ea..6ab066d77d24bc42d41a47fabff534a1b65ae490 100644 (file)
@@ -551,8 +551,11 @@ retry:
        if (nr->num_workers == 1) {
                worker = nr->workers[0];
                if (worker->blocked) {
-                        RATE_LIMIT_GLOBAL(ERROR, "Failed sending packet to worker - "
-                                          "In single-threaded mode and worker is blocked");
+                       RATE_LIMIT_GLOBAL(ERROR, "Failed sending packet to worker - "
+                                         "In single-threaded mode and worker is blocked");
+               drop:
+                       worker->stats.dropped++;
+                       fr_message_done(&cd->m);
                        return -1;
                }
 
@@ -590,7 +593,7 @@ retry:
                if (!found) {
                         RATE_LIMIT_GLOBAL(ERROR, "Failed sending packet to worker - Couldn't find active worker, "
                                           "%u/%u workers are blocked", nr->num_blocked, nr->num_workers);
-                       return -1;
+                        goto drop;
                }
 
                worker = found;
@@ -615,6 +618,7 @@ retry:
 
                if (nr->num_blocked == nr->num_workers) {
                        fr_network_suspend(nr);
+                       fr_message_done(&cd->m);
                        return -1;
                }
                goto retry;