]> granicus.if.org Git - apache/commitdiff
Merge r1821504, r1821505 from trunk:
authorYann Ylavic <ylavic@apache.org>
Thu, 18 Jan 2018 16:07:32 +0000 (16:07 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 18 Jan 2018 16:07:32 +0000 (16:07 +0000)
mpm_{event,worker}: Mask signals for threads created by modules in child init.

PR 62009, so that they don't receive (implicitely) the ones meant for the MPM.

Inspired by: Armin Abfalterer <a.abfalterer gmail.com>

Follow up to r1821504: same comment in event than in worker.

Proposed by: ylavic
Reviewed by: ylavic, icing, covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1821517 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/mpm/event/event.c
server/mpm/worker/worker.c

diff --git a/CHANGES b/CHANGES
index 7dc45207c4a7b33a2d789bebb157a93178576a46..85357b27157934a35a6abcdb9583feacaaa146ed 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.30
  
+  *) mpm_event,worker: Mask signals for threads created by modules in child
+     init, so that they don't receive (implicitely) the ones meant for the MPM.
+     PR 62009. [Armin Abfalterer <a.abfalterer gmail com>, Yann Ylavic]
+
   *) mod_md: new experimental, module for managing domains across virtual hosts,
      implementing the Let's Encrypt ACMEv1 protocol to signup and renew 
      certificates. Please read the modules documentation for further instructions
index 3848279a5f93f7a241dc03e1f2f6a06122438583..8e0f72dedcb2d1996c836c4bdb7a0b2fb62f8456 100644 (file)
@@ -2380,6 +2380,7 @@ static void child_main(int child_num_arg, int child_bucket)
     /*stuff to do before we switch id's, so we have permissions. */
     ap_reopen_scoreboard(pchild, NULL, 0);
 
+    /* done with init critical section */
     if (ap_run_drop_privileges(pchild, ap_server_conf)) {
         clean_child_exit(APEXIT_CHILDFATAL);
     }
@@ -2388,13 +2389,12 @@ static void child_main(int child_num_arg, int child_bucket)
     APR_RING_INIT(&timer_free_ring, timer_event_t, link);
     apr_skiplist_init(&timer_skiplist, pchild);
     apr_skiplist_set_compare(timer_skiplist, timer_comp, timer_comp);
-    ap_run_child_init(pchild, ap_server_conf);
-
-    /* done with init critical section */
 
     /* Just use the standard apr_setup_signal_thread to block all signals
      * from being received.  The child processes no longer use signals for
-     * any communication with the parent process.
+     * any communication with the parent process. Let's also do this before
+     * child_init() hooks are called and possibly create threads that
+     * otherwise could "steal" (implicitely) MPM's signals.
      */
     rv = apr_setup_signal_thread();
     if (rv != APR_SUCCESS) {
@@ -2403,6 +2403,8 @@ static void child_main(int child_num_arg, int child_bucket)
         clean_child_exit(APEXIT_CHILDFATAL);
     }
 
+    ap_run_child_init(pchild, ap_server_conf);
+
     if (ap_max_requests_per_child) {
         conns_this_child = ap_max_requests_per_child;
     }
index 776ae7fc2de40a4015c56979b5fb84df2c68ad6b..1d513871356f1c399ba0aa178fa340097f8941fc 100644 (file)
@@ -1106,17 +1106,16 @@ static void child_main(int child_num_arg, int child_bucket)
         clean_child_exit(APEXIT_CHILDFATAL);
     }
 
+    /* done with init critical section */
     if (ap_run_drop_privileges(pchild, ap_server_conf)) {
         clean_child_exit(APEXIT_CHILDFATAL);
     }
 
-    ap_run_child_init(pchild, ap_server_conf);
-
-    /* done with init critical section */
-
     /* Just use the standard apr_setup_signal_thread to block all signals
      * from being received.  The child processes no longer use signals for
-     * any communication with the parent process.
+     * any communication with the parent process. Let's also do this before
+     * child_init() hooks are called and possibly create threads that
+     * otherwise could "steal" (implicitely) MPM's signals.
      */
     rv = apr_setup_signal_thread();
     if (rv != APR_SUCCESS) {
@@ -1125,6 +1124,8 @@ static void child_main(int child_num_arg, int child_bucket)
         clean_child_exit(APEXIT_CHILDFATAL);
     }
 
+    ap_run_child_init(pchild, ap_server_conf);
+
     if (ap_max_requests_per_child) {
         requests_this_child = ap_max_requests_per_child;
     }