]> granicus.if.org Git - apache/commitdiff
WinNT MPM: Improve robustness under heavy load.
authorJeff Trawick <trawick@apache.org>
Sat, 9 Apr 2011 16:19:33 +0000 (16:19 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 9 Apr 2011 16:19:33 +0000 (16:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1090621 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/mpm/winnt/child.c

diff --git a/CHANGES b/CHANGES
index 917523fe6df388c871663ecbaa3a2ccf1ba60296..6e9b68ea96acc6fd0e0714b6721ab819d90fa844 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 
 Changes with Apache 2.3.12
 
+  *) WinNT MPM: Improve robustness under heavy load.  [Jeff Trawick]
+
   *) MinGW build improvements.  PR 49535.  [John Vandenberg 
      <jayvdb gmail.com>, Jeff Trawick]
 
index 2eee477b929af1cc6b344e57923afbea299c593e..3ef137c196288eed0d4365c375ccb6734e7a39cc 100644 (file)
@@ -137,11 +137,12 @@ static void mpm_recycle_completion_context(winnt_conn_ctx_t *context)
     }
 }
 
-static winnt_conn_ctx_t *mpm_get_completion_context(void)
+static winnt_conn_ctx_t *mpm_get_completion_context(int *timeout)
 {
     apr_status_t rv;
     winnt_conn_ctx_t *context = NULL;
 
+    *timeout = 0;
     while (1) {
         /* Grab a context off the queue */
         apr_thread_mutex_lock(qlock);
@@ -186,6 +187,7 @@ static winnt_conn_ctx_t *mpm_get_completion_context(void)
                         ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
                                      "mpm_get_completion_context: Failed to get a "
                                      "free context within 1 second");
+                        *timeout = 1;
                     }
                     else {
                         /* should be the unexpected, generic WAIT_FAILED */
@@ -358,15 +360,19 @@ reinit: /* target of data or connect upon too many AcceptEx failures */
 
     while (!shutdown_in_progress) {
         if (!context) {
-            context = mpm_get_completion_context();
+            int timeout;
+
+            context = mpm_get_completion_context(&timeout);
             if (!context) {
-                /* Hopefully a temporary condition in the provider? */
-                ++err_count;
-                if (err_count > MAX_ACCEPTEX_ERR_COUNT) {
-                    ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf,
-                                 "winnt_accept: Too many failures grabbing a "
-                                 "connection ctx.  Aborting.");
-                    break;
+                if (!timeout) {
+                    /* Hopefully a temporary condition in the provider? */
+                    ++err_count;
+                    if (err_count > MAX_ACCEPTEX_ERR_COUNT) {
+                        ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf,
+                                     "winnt_accept: Too many failures grabbing a "
+                                     "connection ctx.  Aborting.");
+                        break;
+                    }
                 }
                 Sleep(100);
                 continue;