]> granicus.if.org Git - apache/commitdiff
On exit, don't write to other generations' scoreboard slots
authorStefan Fritsch <sf@apache.org>
Mon, 11 Apr 2016 19:52:35 +0000 (19:52 +0000)
committerStefan Fritsch <sf@apache.org>
Mon, 11 Apr 2016 19:52:35 +0000 (19:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738632 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/event/event.c

index c0d55e5d9fa2843a4f5fa81848df4bb588c38d74..453d7d370cb1939d6b1f0294fe25f732dc1e6cb5 100644 (file)
@@ -1276,12 +1276,18 @@ static void close_listeners(int process_slot, int *closed)
 {
     if (!*closed) {
         int i;
+        worker_score *ws;
         disable_listensocks(process_slot);
         ap_close_listeners_ex(my_bucket->listeners);
         *closed = 1;
         dying = 1;
         ap_scoreboard_image->parent[process_slot].quiescing = 1;
         for (i = 0; i < threads_per_child; ++i) {
+            ws = ap_get_scoreboard_worker_from_indexes(process_slot, i);
+            if (ws->pid != ap_my_pid) {
+                /* scoreboard slot still in use by previous generation */
+                continue;
+            }
             ap_update_child_status_from_indexes(process_slot, i,
                                                 SERVER_GRACEFUL, NULL);
         }