Commit 9116ab2a authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1739008, r1739146, r1739151, r1739193 from trunk:

scoreboard/status: Keep previous worker connection/request data when idle as
prior to 2.4.20.


scoreboard/status: follow up to r1739008.
Restore (completely) pre-2.4.20 behaviour w.r.t. preserved values.
r1739008 was still unnessessarily blanking some values for the time of
BUSY_READ -> BUSY_WRITE (with blocking MPMs).


scoreboard/status: follow up to 1739146.
Comment not needed anymore...


Clarify CHANGES entry, including the correct version for the
restored behaviour.

Submitted by: ylavic
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1741240 13f79535-47bb-0310-9956-ffa450edef68
parent 5d8d7569
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@

Changes with Apache 2.4.21

  *) scoreboard/status: Restore behavior of showing workers' previous Client,
     VHost and Request values when idle, like in 2.4.18 and earlier. 

  *) mod_http2: r->protocol changed to "HTTP/2.0" (was "HTTP/2") as this will
     give expected syntax in CGI's SERVER_PROTOCOL is more compatible with
     existing major/minor handling. Fixes PR 59313.
+0 −11
Original line number Diff line number Diff line
@@ -114,17 +114,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) scoreboard/status: Keep previous worker connection/request data when idle as
     prior to 2.4.20.
     trunk patch: http://svn.apache.org/r1739008
     trunk patch: http://svn.apache.org/r1739146
     trunk patch: http://svn.apache.org/r1739151
     trunk patch: http://svn.apache.org/r1739193
     2.4.x patch: trunk works (modulo CHANGES) or
                  http://home.apache.org/~ylavic/patches/httpd-2.4.x-scoreboard_preserve-v2.patch
     +1: ylavic, rpluem, jim
     ylavic: diff with 2.4.18 after this merge:
             http://home.apache.org/~ylavic/patches/scoreboard-2.4.18.diff


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
+40 −48
Original line number Diff line number Diff line
@@ -464,23 +464,19 @@ static int update_child_status_internal(int child_num,
{
    int old_status;
    worker_score *ws;
    process_score *ps;
    int mpm_generation;

    ws = &ap_scoreboard_image->servers[child_num][thread_num];
    old_status = ws->status;
    if (status >= 0) {
    ws->status = status;
    
        ps = &ap_scoreboard_image->parent[child_num];
        
    if (status == SERVER_READY
        && old_status == SERVER_STARTING) {
        process_score *ps = &ap_scoreboard_image->parent[child_num];
        ws->thread_num = child_num * thread_limit + thread_num;
        ap_mpm_query(AP_MPMQ_GENERATION, &mpm_generation);
        ps->generation = mpm_generation;
    }
    }

    if (ap_extended_status) {
        const char *val;
@@ -497,19 +493,14 @@ static int update_child_status_internal(int child_num,
            ws->conn_bytes = 0;
            ws->last_used = apr_time_now();
        }
        if (status == SERVER_READY) {
            ws->client[0]='\0';
            ws->vhost[0]='\0';
            ws->request[0]='\0';
            ws->protocol[0]='\0';
        }
        else {

        if (descr) {
            apr_cpystrn(ws->request, descr, sizeof(ws->request));
        }
        else if (r) {
            copy_request(ws->request, sizeof(ws->request), r);
        }

        if (r) {
            if (!(val = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL)))
                apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client));
@@ -523,6 +514,7 @@ static int update_child_status_internal(int child_num,
            else
                apr_cpystrn(ws->client, val, sizeof(ws->client));
        }

        if (s) {
            if (c) {
                apr_snprintf(ws->vhost, sizeof(ws->vhost), "%s:%d",
@@ -532,12 +524,12 @@ static int update_child_status_internal(int child_num,
                apr_cpystrn(ws->vhost, s->server_hostname, sizeof(ws->vhost));
            }
        }

        if (c) {
            val = ap_get_protocol(c);
            apr_cpystrn(ws->protocol, val, sizeof(ws->protocol));
        }
    }
    }

    return old_status;
}