You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2015/10/19 22:13:30 UTC

svn commit: r1709474 - in /tcl/rivet/trunk: ChangeLog src/mod_rivet/mod_rivet.c src/mod_rivet/rivet_worker_mpm.c

Author: mxmanghi
Date: Mon Oct 19 20:13:30 2015
New Revision: 1709474

URL: http://svn.apache.org/viewvc?rev=1709474&view=rev
Log:
    * src/mod_rivet/rivet_worker_mpm.c: returning HTTP_INTERNAL_SERVER_ERROR to requests coming in during a process shutdown. This is required by the exit command handling
    * src/mod_rivet/mod_rivet.c: changed some log message calls
    in order to have ap_log_rerror when an error occurs during
    a request processing 


Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/src/mod_rivet/mod_rivet.c
    tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1709474&r1=1709473&r2=1709474&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Mon Oct 19 20:13:30 2015
@@ -1,3 +1,11 @@
+2015-10-18 Massimo Manghi <mx...@apache.org>
+    * src/mod_rivet/rivet_worker_mpm.c: returning HTTP_INTERNAL_SERVER_ERROR
+    to requests coming in during a process shutdown. This is required
+    by the exit command handling
+    * src/mod_rivet/mod_rivet.c: changed some log message calls
+    in order to have ap_log_rerror when an error occurs during
+    a request processing 
+
 2015-10-17 Massimo Manghi <mx...@apache.org>
     * src/mod_rivet/rivet_worker_mpm.c,rivet_prefork_mpm.c,mod_rivet.c:
     bridge jump table macro definition

Modified: tcl/rivet/trunk/src/mod_rivet/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/mod_rivet.c?rev=1709474&r1=1709473&r2=1709474&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/mod_rivet.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/mod_rivet.c Mon Oct 19 20:13:30 2015
@@ -666,11 +666,11 @@ Rivet_SendContent(rivet_thread_private *
     /* and finally we run the request_cleanup procedure (always set) */
 
     if (Tcl_EvalObjEx(interp, private->request_cleanup, 0) == TCL_ERROR) {
-        request_rec* r = private->r;
 
-        ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r->server, 
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, private->r, 
                      MODNAME ": Error evaluating cleanup request: %s",
                      Tcl_GetVar(interp, "errorInfo", 0));
+
     }
 
     /* We finalize the request processing by printing the headers and flushing
@@ -695,6 +695,8 @@ sendcleanup:
     
     if (private->thread_exit)
     {
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL, private->r, 
+                                  "process terminating with code %d",private->exit_status);
         RIVET_MPM_BRIDGE_CALL(mpm_exit_handler,private->exit_status);
         Tcl_Exit(private->exit_status);
     }
@@ -1449,20 +1451,23 @@ Rivet_ServerInit (apr_pool_t *pPool, apr
     {
 
         /* Execution shouldn't get here as a failure querying about MPM is supposed
-         * to be return APR_SUCCESS in every normal operative conditions. We
+         * to return APR_SUCCESS in every normal operative conditions. We
          * give a default to the MPM bridge anyway
          */
 
         module_globals->rivet_mpm_bridge = apr_pstrdup(pPool,mpm_worker_bridge);
     }
 
-    /* We have the chance to tell mod_rivet through an env variable where the bridge has to be loaded from */
+    /* With the env variable RIVET_MPM_BRIDGE we have the chance to tell mod_rivet 
+       what bridge custom implementation we want to be loaded */
 
     if (apr_env_get (&mpm_model_path,"RIVET_MPM_BRIDGE",pTemp) != APR_SUCCESS)
     {
         mpm_model_path = apr_pstrcat(pTemp,RIVET_DIR,"/mpm/",module_globals->rivet_mpm_bridge,NULL);
     } 
 
+    /* Finally the bridge is loaded and the jump table sought */
+
     if (apr_dso_load(&dso_handle,mpm_model_path,pPool) == APR_SUCCESS)
     {
         apr_status_t                rv;

Modified: tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c?rev=1709474&r1=1709473&r2=1709474&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c Mon Oct 19 20:13:30 2015
@@ -417,6 +417,8 @@ static void* APR_THREAD_FUNC threaded_br
 
         }
     }
+
+    ap_log_error(APLOG_MARK,APLOG_DEBUG,APR_SUCCESS,module_globals->server,"Worker bridge supervisor shuts down");
     apr_thread_exit(thd,APR_SUCCESS);
 
     return NULL;
@@ -582,6 +584,12 @@ int Worker_MPM_Request (request_rec* r,r
 
         return HTTP_INTERNAL_SERVER_ERROR;
 
+    } else if (module_globals->mpm->server_shutdown == 1) {
+
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r, MODNAME ": http request aborted during child process shutdown");
+
+        return HTTP_INTERNAL_SERVER_ERROR;
+
     } else {
 
         /* if the thread is serving its first request we allocate its private data from the thread pool */
@@ -603,7 +611,7 @@ int Worker_MPM_Request (request_rec* r,r
 
             apr_pool_cleanup_register(tpool,(void *)request_private,Worker_RequestPrivateCleanup,apr_pool_cleanup_null);
 
-            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r,  MODNAME ": request thread private data allocated");
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, MODNAME ": request thread private data allocated");
 
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org