PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * worker MPM: Don't forcibly kill worker threads if the child process is
- exiting gracefully.
- trunk: http://svn.apache.org/r1526220
- 2.4.x: http://people.apache.org/~trawick/r1526220-2.4.x.txt
- +1: trawick, jim, rjung
-
* ab: Add wait time, fix processing time, make write errors output conditional
trunk: http://svn.apache.org/viewvc?view=revision&revision=1488471
2.4.x: trunk patch works (minus CHANGES)
return NULL;
}
-static void join_workers(apr_thread_t *listener, apr_thread_t **threads)
+static void join_workers(apr_thread_t *listener, apr_thread_t **threads,
+ int mode)
{
int i;
apr_status_t rv, thread_rv;
for (i = 0; i < threads_per_child; i++) {
if (threads[i]) { /* if we ever created this thread */
+ if (mode != ST_GRACEFUL) {
#ifdef HAVE_PTHREAD_KILL
- apr_os_thread_t *worker_os_thread;
+ apr_os_thread_t *worker_os_thread;
- apr_os_thread_get(&worker_os_thread, threads[i]);
- pthread_kill(*worker_os_thread, WORKER_SIGNAL);
+ apr_os_thread_get(&worker_os_thread, threads[i]);
+ pthread_kill(*worker_os_thread, WORKER_SIGNAL);
#endif
+ }
rv = apr_thread_join(&thread_rv, threads[i]);
if (rv != APR_SUCCESS) {
* If the worker hasn't exited, then this blocks until
* they have (then cleans up).
*/
- join_workers(ts->listener, threads);
+ join_workers(ts->listener, threads, ST_UNGRACEFUL);
}
else { /* !one_process */
/* remove SIGTERM from the set of blocked signals... if one of
* If the worker hasn't exited, then this blocks until
* they have (then cleans up).
*/
- join_workers(ts->listener, threads);
+ join_workers(ts->listener, threads,
+ rv == AP_GRACEFUL ? ST_GRACEFUL : ST_UNGRACEFUL);
}
free(threads);