Commit a489a662 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1738628, r1757009, r1756848, r1757029 from trunk:

Display process slot number in the async overview 


Fix the number of column for 'Async connections'.
There are only 3 columns (writing, keep-alive, closing), not 4.

Try to improve the code layout for it to be more readable.
Each <th> is on its own line so keep the corresponding "colspan" <td> fields grouped together.

r1738628 introduced a new column, 'Slot'.
Add an empty cell for it in the last line of the table, in order to fix the layout of the Totals.

Replace tab by spaces to be consistent

mod_status: note stopping procs in async info table

* add new column "stopping", denoting if a process is shutting down
* add additional "(old gen)", if a process is from before a graceful reload
* add counts of processes and stopping processes to summary line


Submitted by: sf, jailletc36, jailletc36, sf
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1772333 13f79535-47bb-0310-9956-ffa450edef68
parent a9077d1c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -15,6 +15,9 @@ Changes with Apache 2.4.24
  *) mod_ssl: Fix quick renegotiation (OptRenegotiaton) with no intermediate
     in the client certificate chain.  PR 55786.  [Yann Ylavic]

  *) mod_status: Display the process slot number in the async connection
     overview. [Stefan Fritsch]

  *) mod_dir: Responses that go through "FallbackResource" might appear to
     hang due to unterminated chunked encoding. PR58292. [Eric Covener]

+35 −14
Original line number Diff line number Diff line
@@ -531,7 +531,7 @@ static int status_handler(request_rec *r)

    if (is_async) {
        int write_completion = 0, lingering_close = 0, keep_alive = 0,
            connections = 0;
            connections = 0, stopping = 0, procs = 0;
        /*
         * These differ from 'busy' and 'ready' in how gracefully finishing
         * threads are counted. XXX: How to make this clear in the html?
@@ -539,13 +539,15 @@ static int status_handler(request_rec *r)
        int busy_workers = 0, idle_workers = 0;
        if (!short_report)
            ap_rputs("\n\n<table rules=\"all\" cellpadding=\"1%\">\n"
                     "<tr><th rowspan=\"2\">PID</th>"
                     "<tr><th rowspan=\"2\">Slot</th>"
                         "<th rowspan=\"2\">PID</th>"
                         "<th rowspan=\"2\">Stopping</th>"
                         "<th colspan=\"2\">Connections</th>\n"
                         "<th colspan=\"2\">Threads</th>"
                         "<th colspan=\"4\">Async connections</th></tr>\n"
                         "<th colspan=\"3\">Async connections</th></tr>\n"
                     "<tr><th>total</th><th>accepting</th>"
                         "<th>busy</th><th>idle</th><th>writing</th>"
                         "<th>keep-alive</th><th>closing</th></tr>\n", r);
                         "<th>busy</th><th>idle</th>"
                         "<th>writing</th><th>keep-alive</th><th>closing</th></tr>\n", r);
        for (i = 0; i < server_limit; ++i) {
            ps_record = ap_get_scoreboard_process(i);
            if (ps_record->pid) {
@@ -555,26 +557,45 @@ static int status_handler(request_rec *r)
                lingering_close  += ps_record->lingering_close;
                busy_workers     += thread_busy_buffer[i];
                idle_workers     += thread_idle_buffer[i];
                if (!short_report)
                    ap_rprintf(r, "<tr><td>%" APR_PID_T_FMT "</td><td>%u</td>"
                                      "<td>%s</td><td>%u</td><td>%u</td>"
                if (!short_report) {
                    const char *dying = "no";
                    const char *old = "";
                    if (ps_record->quiescing) {
                        dying = "yes";
                        stopping++;
                    }
                    if (ps_record->generation != mpm_generation)
                        old = " (old gen)";
                    procs++;
                    ap_rprintf(r, "<tr><td>%u</td><td>%" APR_PID_T_FMT "</td>"
                                      "<td>%s%s</td>"
                                      "<td>%u</td><td>%s</td>"
                                      "<td>%u</td><td>%u</td>"
                                      "<td>%u</td><td>%u</td><td>%u</td>"
                                      "</tr>\n",
                               ps_record->pid, ps_record->connections,
                               i, ps_record->pid,
                               dying, old,
                               ps_record->connections,
                               ps_record->not_accepting ? "no" : "yes",
                               thread_busy_buffer[i], thread_idle_buffer[i],
                               thread_busy_buffer[i],
                               thread_idle_buffer[i],
                               ps_record->write_completion,
                               ps_record->keep_alive,
                               ps_record->lingering_close);
                }
            }
        }
        if (!short_report) {
            ap_rprintf(r, "<tr><td>Sum</td><td>%d</td><td>&nbsp;</td><td>%d</td>"
                          "<td>%d</td><td>%d</td><td>%d</td><td>%d</td>"
            ap_rprintf(r, "<tr><td>Sum</td>"
                          "<td>%d</td><td>%d</td>"
                          "<td>%d</td><td>&nbsp;</td>"
                          "<td>%d</td><td>%d</td>"
                          "<td>%d</td><td>%d</td><td>%d</td>"
                          "</tr>\n</table>\n",
                          connections, busy_workers, idle_workers,
                          procs, stopping,
                          connections,
                          busy_workers, idle_workers,
                          write_completion, keep_alive, lingering_close);

        }
        else {
            ap_rprintf(r, "ConnsTotal: %d\n"