Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 96438 invoked from network); 28 Mar 2009 17:41:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Mar 2009 17:41:34 -0000 Received: (qmail 51853 invoked by uid 500); 28 Mar 2009 17:41:33 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 51750 invoked by uid 500); 28 Mar 2009 17:41:33 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 51741 invoked by uid 99); 28 Mar 2009 17:41:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Mar 2009 17:41:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Mar 2009 17:41:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 597BD2388979; Sat, 28 Mar 2009 17:41:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r759518 - /httpd/httpd/trunk/modules/mappers/mod_watchdog.c Date: Sat, 28 Mar 2009 17:41:10 -0000 To: cvs@httpd.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090328174110.597BD2388979@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mturk Date: Sat Mar 28 17:41:09 2009 New Revision: 759518 URL: http://svn.apache.org/viewvc?rev=759518&view=rev Log: Query the mpm state and clear the running flag if mpm is stopping. Modified: httpd/httpd/trunk/modules/mappers/mod_watchdog.c Modified: httpd/httpd/trunk/modules/mappers/mod_watchdog.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_watchdog.c?rev=759518&r1=759517&r2=759518&view=diff ============================================================================== --- httpd/httpd/trunk/modules/mappers/mod_watchdog.c (original) +++ httpd/httpd/trunk/modules/mappers/mod_watchdog.c Sat Mar 28 17:41:09 2009 @@ -95,6 +95,7 @@ int locked = 0; int probed = 0; int inited = 0; + int mpmq_s = 0; w->pool = apr_thread_pool_get(thread); w->is_running = 1; @@ -102,6 +103,14 @@ apr_thread_mutex_unlock(w->startup); if (w->mutex) { while (w->is_running) { + if (ap_mpm_query(AP_MPMQ_MPM_STATE, &mpmq_s) != APR_SUCCESS) { + w->is_running = 0; + break; + } + if (mpmq_s == AP_MPMQ_STOPPING) { + w->is_running = 0; + break; + } rv = apr_proc_mutex_trylock(w->mutex); if (rv == APR_SUCCESS) { if (probed) { @@ -115,6 +124,14 @@ while (w->is_running && probed > 0) { apr_sleep(AP_WD_TM_INTERVAL); probed--; + if (ap_mpm_query(AP_MPMQ_MPM_STATE, &mpmq_s) != APR_SUCCESS) { + w->is_running = 0; + break; + } + if (mpmq_s == AP_MPMQ_STOPPING) { + w->is_running = 0; + break; + } } } locked = 1; @@ -155,6 +172,12 @@ watchdog_list_t *wl = w->callbacks; apr_sleep(AP_WD_TM_SLICE); + if (ap_mpm_query(AP_MPMQ_MPM_STATE, &mpmq_s) != APR_SUCCESS) { + w->is_running = 0; + } + if (mpmq_s == AP_MPMQ_STOPPING) { + w->is_running = 0; + } if (!w->is_running) { break; } @@ -169,6 +192,12 @@ /* Execute watchdog callback */ wl->status = (*wl->callback_fn)(AP_WATCHDOG_STATE_RUNNING, (void *)wl->data, ctx); + if (ap_mpm_query(AP_MPMQ_MPM_STATE, &mpmq_s) != APR_SUCCESS) { + w->is_running = 0; + } + if (mpmq_s == AP_MPMQ_STOPPING) { + w->is_running = 0; + } } } wl = wl->next; @@ -211,10 +240,10 @@ wl = wl->next; } } - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, wd_server_conf->s, - "%sWatchdog (%s) stopping (%" APR_PID_T_FMT ")", - w->singleton ? "Singleton" : "", - w->name, getpid()); + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, wd_server_conf->s, + "%sWatchdog (%s) stopping (%" APR_PID_T_FMT ")", + w->singleton ? "Singleton" : "", + w->name, getpid()); if (locked) apr_proc_mutex_unlock(w->mutex);