You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2009/09/18 20:05:57 UTC

svn commit: r816730 - in /httpd/mod_fcgid/trunk: CHANGES-FCGID docs/manual/mod/mod_fcgid.xml modules/fcgid/fcgid_bridge.c modules/fcgid/fcgid_conf.c modules/fcgid/fcgid_conf.h modules/fcgid/fcgid_pm_main.c

Author: trawick
Date: Fri Sep 18 18:05:57 2009
New Revision: 816730

URL: http://svn.apache.org/viewvc?rev=816730&view=rev
Log:
BusyTimeout can only have a single (global) setting, or the 
current BusyTimeout processing* fails.  Don't allow BusyTimeout
to have a different value inside a virtual host.

*This current processing is not completely reliable even when
the request thread and the daemon think BusyTimeout has the 
same value.  I opened BZ #47873 to describe the issue, and I
referred to that bug report in the several related sections 
of code.

Modified:
    httpd/mod_fcgid/trunk/CHANGES-FCGID
    httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c

Modified: httpd/mod_fcgid/trunk/CHANGES-FCGID
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/CHANGES-FCGID?rev=816730&r1=816729&r2=816730&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/CHANGES-FCGID [utf8] (original)
+++ httpd/mod_fcgid/trunk/CHANGES-FCGID [utf8] Fri Sep 18 18:05:57 2009
@@ -9,9 +9,8 @@
 
   *) Merge mod_fcgid server config/virtual host directives so that they can
      be inherited or overridden within a virtual host as expected.  Affected
-     directives: BusyTimeout, IPCCommTimeout, IPCConnectTimeout, 
-     MaxRequestInMem, MaxRequestLen, MaxRequestsPerProcess, OutputBufferSize.
-     [Jeff Trawick]
+     directives: IPCCommTimeout, IPCConnectTimeout, MaxRequestInMem,
+     MaxRequestLen, MaxRequestsPerProcess, OutputBufferSize. [Jeff Trawick]
 
   *) Use the virtual host settings for the request being processed instead
      of those of the first FastCGI request handled by this httpd child process.
@@ -19,7 +18,7 @@
      MaxRequestsPerProcess, and OutputBufferSize.  [Jeff Trawick]
 
   *) The following directives are no longer allowed in a virtual host
-     context: BusyScanInterval, DefaultMaxClassProcessCount, 
+     context: BusyScanInterval, BusyTimeout, DefaultMaxClassProcessCount, 
      DefaultMinProcessCount, ErrorScanInterval, IdleScanInterval, 
      IdleTimeout, MaxProcessCount, PHP_Fix_Pathinfo_Enable, 
      ProcessLifetime, SharedmemPath, SocketPath, SpawnScore,

Modified: httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml?rev=816730&r1=816729&r2=816730&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml (original)
+++ httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml Fri Sep 18 18:05:57 2009
@@ -77,7 +77,7 @@
     <description>a FastCGI application will be killed after handling a request for BusyTimeout</description>
     <syntax>BusyTimeout <em>seconds</em></syntax>
     <default>BusyTimeout 300</default>
-    <contextlist><context>server config</context> <context>virtual host</context></contextlist>
+    <contextlist><context>server config</context></contextlist>
     <usage>
       <p>This is the maximum time limit for request handling.  If a FastCGI
       request does not complete within BusyTimeout seconds, it will be

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c?rev=816730&r1=816729&r2=816730&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c Fri Sep 18 18:05:57 2009
@@ -173,6 +173,7 @@
     proc_close_ipc(&ctx->ipc);
 
     if (ctx->procnode) {
+        /* FIXME See BZ #47483 */
         /* Return procnode
            I will return this slot to idle(or error) list except:
            I take too much time on this request( greater than BusyTimeout) ),
@@ -186,8 +187,8 @@
         if (dt > sconf->busy_timeout) {
             /* Do nothing but print log */
             ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
-                          "mod_fcgid: process busy timeout, took %d seconds for this request",
-                          dt);
+                          "mod_fcgid: process busy timeout (%d), took %d seconds for this request",
+                          sconf->busy_timeout, dt);
         } else if (ctx->has_error) {
             ctx->procnode->diewhy = FCGID_DIE_COMM_ERROR;
             return_procnode(s, ctx->procnode,

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c?rev=816730&r1=816729&r2=816730&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c Fri Sep 18 18:05:57 2009
@@ -59,6 +59,7 @@
 
     if (!s->is_virtual) {
         config->busy_scan_interval = DEFAULT_BUSY_SCAN_INTERVAL;
+        config->busy_timeout = DEFAULT_BUSY_TIMEOUT;
         config->max_class_process_count = DEFAULT_MAX_CLASS_PROCESS_COUNT;
         config->min_class_process_count = DEFAULT_MIN_CLASS_PROCESS_COUNT;
         config->error_scan_interval = DEFAULT_ERROR_SCAN_INTERVAL;
@@ -81,7 +82,6 @@
      * config->php_fix_pathinfo_enable = 0;
      * config->*_set = 0;
      */
-    config->busy_timeout = DEFAULT_BUSY_TIMEOUT;
     config->ipc_comm_timeout = DEFAULT_IPC_COMM_TIMEOUT;
     config->ipc_connect_timeout = DEFAULT_IPC_CONNECT_TIMEOUT;
     config->max_mem_request_len = DEFAULT_MAX_MEM_REQUEST_LEN;
@@ -133,9 +133,11 @@
                            local->pass_headers);
     }
 
+    /* FIXME See BZ #47483 */
+    merged->busy_timeout = base->busy_timeout;
+
     /* Merge the scalar settings */
 
-    MERGE_SCALAR(base, local, merged, busy_timeout);
     MERGE_SCALAR(base, local, merged, ipc_comm_timeout);
     MERGE_SCALAR(base, local, merged, ipc_connect_timeout);
     MERGE_SCALAR(base, local, merged, max_mem_request_len);
@@ -196,8 +198,13 @@
     server_rec *s = cmd->server;
     fcgid_server_conf *config =
         ap_get_module_config(s->module_config, &fcgid_module);
+    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+
+    if (err != NULL) {
+        return err;
+    }
+
     config->busy_timeout = atol(arg);
-    config->busy_timeout_set = 1;
     return NULL;
 }
 

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h?rev=816730&r1=816729&r2=816730&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.h Fri Sep 18 18:05:57 2009
@@ -64,6 +64,7 @@
 typedef struct {
     /* global only */
     int busy_scan_interval;
+    int busy_timeout;
     int max_class_process_count;
     int min_class_process_count;
     int error_scan_interval;
@@ -82,10 +83,6 @@
     /* global or vhost
      * scalar values have corresponding _set field to aid merging
      */
-    int busy_timeout; /* TODO: Does setting this in a vhost work as expected?
-                       * Look at use in PM vs. handler.
-                       */
-    int busy_timeout_set;
     apr_table_t *default_init_env;
     int ipc_comm_timeout;
     int ipc_comm_timeout_set;

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c?rev=816730&r1=816729&r2=816730&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c Fri Sep 18 18:05:57 2009
@@ -134,6 +134,7 @@
         next_node = &proc_table[current_node->next_index];
 
         last_active_time = current_node->last_active_time;
+        /* FIXME See BZ #47483 */
         if (apr_time_sec(now) - apr_time_sec(last_active_time) >
             (sconf->busy_timeout + 10)) {
             /* Set dir reason for log */