]> granicus.if.org Git - apache/commitdiff
Merge r1294349 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 23 Jul 2012 12:30:19 +0000 (12:30 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 23 Jul 2012 12:30:19 +0000 (12:30 +0000)
Prevent listener thread from ever updating a worker's scoreboard slot

The worker may be doing something else by now. This should take
care of slots staying in "L" state in the scoreboard

Submitted by: sf
Reviewed/backported by: jim

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

STATUS
server/mpm/event/event.c

diff --git a/STATUS b/STATUS
index 9e596dd448749f467cefe8fae2712c9fdef7d830..7d1476783813b9d626736118b15b73858c01060b 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -88,11 +88,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mpm_event: Fix slots staying in "L" state in the scoreboard
-     trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1294349
-     2.4.x patch: trunk patch works (needs CHANGES entry)
-     +1: sf, rjung, jim
-
    * mpm_event: Don't call ap_start_lingering_close from the listener thread
      because it may block
      PR: 52229
index 6c6ac49c7811d0fb243a3dc8532022537a022d66..007d887f7d6794e80eab80c891031f0b0a67900f 100644 (file)
@@ -754,10 +754,6 @@ static int start_lingering_close(event_conn_state_t *cs)
 {
     apr_status_t rv;
 
-    cs->c->sbh = NULL;  /* prevent scoreboard updates from the listener 
-                         * worker will loop around and set SERVER_READY soon
-                         */
-
     if (ap_start_lingering_close(cs->c)) {
         apr_pool_clear(cs->p);
         ap_push_pool(worker_queue_info, cs->p);
@@ -846,6 +842,7 @@ static void process_socket(apr_thread_t *thd, apr_pool_t * p, apr_socket_t * soc
     int rc;
     ap_sb_handle_t *sbh;
 
+    /* XXX: This will cause unbounded mem usage for long lasting connections */
     ap_create_sb_handle(&sbh, p, my_child_num, my_thread_num);
 
     if (cs == NULL) {           /* This is a new connection */
@@ -1002,6 +999,14 @@ read_request:
             AP_DEBUG_ASSERT(rc == APR_SUCCESS);
         }
     }
+    /*
+     * Prevent this connection from writing to our connection state after it
+     * is no longer associated with this thread. This would happen if the EOR
+     * bucket is destroyed from the listener thread due to a connection abort
+     * or timeout.
+     */
+    c->sbh = NULL;
+
     return;
 }