]> granicus.if.org Git - apache/commitdiff
* Give possible piped loggers a chance to process their input before they get
authorRuediger Pluem <rpluem@apache.org>
Wed, 30 Jul 2008 21:08:33 +0000 (21:08 +0000)
committerRuediger Pluem <rpluem@apache.org>
Wed, 30 Jul 2008 21:08:33 +0000 (21:08 +0000)
  killed by us.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@681204 13f79535-47bb-0310-9956-ffa450edef68

server/main.c

index 451d2e20adbfd2dd63e3bfbfa27b9cef9538c949..02a66a5234a383fb7181f6a094d3577a71bb949b 100644 (file)
@@ -259,9 +259,19 @@ static void show_compile_settings(void)
 #endif
 }
 
+#define TASK_SWITCH_SLEEP 10000
+
 static void destroy_and_exit_process(process_rec *process,
                                      int process_exit_value)
 {
+    /*
+     * Sleep for TASK_SWITCH_SLEEP micro seconds to cause a task switch on
+     * OS layer and thus give possibly started piped loggers a chance to
+     * process their input. Otherwise it is possible that they get killed
+     * by us before they can do so. In this case maybe valueable log messages
+     * might get lost.
+     */
+    apr_sleep(TASK_SWITCH_SLEEP);
     apr_pool_destroy(process->pool); /* and destroy all descendent pools */
     apr_terminate();
     exit(process_exit_value);