From 4ab09aa5cfb6206634bd9c3a8db9d49e733242ba Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Mon, 30 Nov 2009 09:14:27 +0100 Subject: [PATCH] Clean up "dead" child if there's no thread associated with the request --- src/main/event.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/event.c b/src/main/event.c index ce9ce46..4134303 100644 --- a/src/main/event.c +++ b/src/main/event.c @@ -488,8 +488,14 @@ static void wait_for_child_to_die(void *ctx) rad_assert(request->magic == REQUEST_MAGIC); + /* + * 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)) { + ((request->child_state == REQUEST_RUNNING) && + (pthread_equal(request->child_pid, NO_SUCH_CHILD_PID) == 0))) { /* * Cap delay at five minutes. -- 2.1.4