Fix corner case when not threaded.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 15 Oct 2010 00:10:18 +0000 (02:10 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 15 Oct 2010 13:35:57 +0000 (15:35 +0200)
If the request is still running after 30s, it's probably because
it was proxied, and the home server didn't bother to respond.

src/main/event.c

index 78bb220..65fcb6b 100644 (file)
@@ -1232,16 +1232,16 @@ static void wait_a_bit(void *ctx)
        case REQUEST_RUNNING:
                /*
                 *      If we're not thread-capable, OR we're capable,
        case REQUEST_RUNNING:
                /*
                 *      If we're not thread-capable, OR we're capable,
-                *      but have been told to run without threads,
-                *      complain when the requests is queued for a
-                *      thread, or running in a child thread.
+                *      but have been told to run without threads, and
+                *      the request is still running.  This is usually
+                *      because the request was proxied, and the home
+                *      server didn't respond.
                 */
 #ifdef HAVE_PTHREAD_H
                if (!have_children)
 #endif
                {
                 */
 #ifdef HAVE_PTHREAD_H
                if (!have_children)
 #endif
                {
-                       rad_assert("We do not have threads, but the request is marked as queued or running in a child thread" == NULL);
-                       break;
+                       goto done;
                }
 
 #ifdef HAVE_PTHREAD_H
                }
 
 #ifdef HAVE_PTHREAD_H
@@ -1312,6 +1312,7 @@ static void wait_a_bit(void *ctx)
                 *      and clean it up.
                 */
        case REQUEST_DONE:
                 *      and clean it up.
                 */
        case REQUEST_DONE:
+       done:
 #ifdef HAVE_PTHREAD_H
                request->child_pid = NO_SUCH_CHILD_PID;
 #endif
 #ifdef HAVE_PTHREAD_H
                request->child_pid = NO_SUCH_CHILD_PID;
 #endif