httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1090621 - in /httpd/httpd/trunk: CHANGES server/mpm/winnt/child.c
Date Sat, 09 Apr 2011 16:19:33 GMT
Author: trawick
Date: Sat Apr  9 16:19:33 2011
New Revision: 1090621

URL: http://svn.apache.org/viewvc?rev=1090621&view=rev
Log:
WinNT MPM: Improve robustness under heavy load.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/mpm/winnt/child.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1090621&r1=1090620&r2=1090621&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Apr  9 16:19:33 2011
@@ -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]
 

Modified: httpd/httpd/trunk/server/mpm/winnt/child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/child.c?rev=1090621&r1=1090620&r2=1090621&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/child.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/child.c Sat Apr  9 16:19:33 2011
@@ -137,11 +137,12 @@ static void mpm_recycle_completion_conte
     }
 }
 
-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_complet
                         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 upo
 
     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;



Mime
View raw message