summaryrefslogtreecommitdiffstats
path: root/debian/patches/child_processes_fail_to_start.patch
blob: 957c8575d287ad1770f6b779c02f1096d1ed8aa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Description: Add upstream patch to fix active daemon accounting
Author: Ondřej Surý <ondrej@sury.org>
Forwarded: not-needed
Reviewed-By: Yadd <yadd@debian.org>
Last-Update: 2022-03-14

--- a/server/mpm/event/event.c
+++ b/server/mpm/event/event.c
@@ -1864,11 +1864,9 @@
                 else if (connections_above_limit(&workers_were_busy)) {
                     disable_listensocks();
                     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
-                                 "Too many open connections (%u), "
+                                 "Too many open connections (%u, %u idlers), "
                                  "not accepting new conns in this process",
-                                 apr_atomic_read32(&connection_count));
-                    ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf,
-                                 "Idle workers: %u",
+                                 apr_atomic_read32(&connection_count),
                                  ap_queue_info_num_idlers(worker_queue_info));
                 }
                 else if (!listener_may_exit) {
@@ -2173,6 +2171,12 @@
         }
     }
 
+#if 0
+    if (is_idle) {
+        ap_queue_info_unset_idle(worker_queue_info);
+    }
+#endif
+
     ap_update_child_status_from_indexes(process_slot, thread_slot,
                                         dying ? SERVER_DEAD
                                               : SERVER_GRACEFUL, NULL);
@@ -2817,6 +2821,12 @@
     int i, j;
 
     for (i = 0; i < server_limit; ++i) {
+        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
+                     "perform_idle_server_maintenance(%i/%i): "
+                     "slot %i/%i, free %i/%i",
+                     child_bucket, num_buckets,
+                     i, retained->max_daemons_limit,
+                     free_length, retained->idle_spawn_rate[child_bucket]);
         if (num_buckets > 1 && (i % num_buckets) != child_bucket) {
             /* We only care about child_bucket in this call */
             continue;
@@ -2832,6 +2842,13 @@
         ps = &ap_scoreboard_image->parent[i];
         if (ps->pid != 0) {
             int child_threads_active = 0;
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
+                         "perform_idle_server_maintenance(%i/%i): "
+                         "slot %i/%i, pid %i, quiescing %i, daemons %i/%i",
+                         child_bucket, num_buckets,
+                         i, retained->max_daemons_limit,
+                         (int)ps->pid, ps->quiescing,
+                         retained->active_daemons, retained->total_daemons);
             if (ps->quiescing == 1) {
                 ps->quiescing = 2;
                 retained->active_daemons--;
@@ -3069,6 +3086,12 @@
 
                 event_note_child_killed(child_slot, 0, 0);
                 ps = &ap_scoreboard_image->parent[child_slot];
+                ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
+                             "server_main_loop(): "
+                             "slot %i/%i, pid %i, quiescing %i, daemons %i/%i",
+                             child_slot, retained->max_daemons_limit,
+                             (int)ps->pid, ps->quiescing,
+                             retained->active_daemons, retained->total_daemons);
                 if (ps->quiescing != 2)
                     retained->active_daemons--;
                 ps->quiescing = 0;