* Give possible piped loggers a chance to process their input before they get
killed by us.
Submitted by: rpluem
Reviewed by: rpluem, jim, gregames
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@695026
13f79535-47bb-0310-9956-
ffa450edef68
http://svn.apache.org/viewvc?rev=639010&view=rev (mmn)
+1: niq, rpluem, mturk
- * core: Give possible piped loggers a chance to process their input before
- they get killed by us.
- Trunk version of patch:
- http://svn.apache.org/viewvc?rev=681204&view=rev
- Backport version for 2.2.x of patch:
- Trunk version of patch works
- +1: rpluem, jim, gregames
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
#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);