]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Clean up "dead" child if there's no thread associated with the request
authorAlan T. DeKok <aland@freeradius.org>
Mon, 30 Nov 2009 08:14:27 +0000 (09:14 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 30 Nov 2009 08:15:46 +0000 (09:15 +0100)
src/main/event.c

index 186bdc5b1b4ba648c3df70930451a6d8817a1004..1d0849ebf9b7f70ef1b17b937c2793bde29eb431 100644 (file)
@@ -469,8 +469,14 @@ static void wait_for_child_to_die(void *ctx)
 
        rad_assert(request->magic == REQUEST_MAGIC);
 
-       if ((request->child_state == REQUEST_QUEUED) |
-           (request->child_state == REQUEST_RUNNING)) {
+       /*
+        *      If it's still queued (waiting for a thread to pick it
+        *      up) OR, it's running AND there's still a child thread
+        *      handling it, THEN delay some more.
+        */
+       if ((request->child_state == REQUEST_QUEUED) ||
+           ((request->child_state == REQUEST_RUNNING) &&
+            (pthread_equal(request->child_pid, NO_SUCH_CHILD_PID) == 0))) {
 
                /*
                 *      Cap delay at five minutes.