Return-Path:
X-Original-To: apmail-httpd-cvs-archive@www.apache.org
Delivered-To: apmail-httpd-cvs-archive@www.apache.org
Received: from mail.apache.org (hermes.apache.org [140.211.11.3])
by minotaur.apache.org (Postfix) with SMTP id 1E27AD112
for ;
Fri, 9 Nov 2012 08:44:36 +0000 (UTC)
Received: (qmail 65778 invoked by uid 500); 9 Nov 2012 08:44:36 -0000
Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org
Received: (qmail 65553 invoked by uid 500); 9 Nov 2012 08:44:34 -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 65526 invoked by uid 99); 9 Nov 2012 08:44:33 -0000
Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230)
by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2012 08:44:33 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Fri, 09 Nov 2012 08:44:30 +0000
Received: from eris.apache.org (localhost [127.0.0.1])
by eris.apache.org (Postfix) with ESMTP id CC91623889FA;
Fri, 9 Nov 2012 08:44:09 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r1407381 - in /httpd/httpd/trunk: CHANGES
docs/manual/mod/mod_cache.xml modules/cache/cache_util.h
modules/cache/mod_cache.c
Date: Fri, 09 Nov 2012 08:44:09 -0000
To: cvs@httpd.apache.org
From: trawick@apache.org
X-Mailer: svnmailer-1.0.8-patched
Message-Id: <20121109084409.CC91623889FA@eris.apache.org>
X-Virus-Checked: Checked by ClamAV on apache.org
Author: trawick
Date: Fri Nov 9 08:44:08 2012
New Revision: 1407381
URL: http://svn.apache.org/viewvc?rev=1407381&view=rev
Log:
The following now respects DefaultRuntimeDir/DEFAULT_REL_RUNTIMEDIR:
- mod_cache: thundering herd lock directory
Modified:
httpd/httpd/trunk/CHANGES
httpd/httpd/trunk/docs/manual/mod/mod_cache.xml
httpd/httpd/trunk/modules/cache/cache_util.h
httpd/httpd/trunk/modules/cache/mod_cache.c
Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1407381&r1=1407380&r2=1407381&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Nov 9 08:44:08 2012
@@ -147,6 +147,7 @@ Changes with Apache 2.5.0
- APIs: ap_log_pid(), ap_remove_pid, ap_read_pid()
- core: the scoreboard (ScoreBoardFile), pid file (PidFile), and
mutexes (Mutex)
+ - mod_cache: thundering herd lock directory
- mod_lbmethod_heartbeat, mod_heartmonitor: heartbeat storage file
- mod_ldap: shared memory cache
- mod_socache_shmcb, mod_socache_dbm: shared memory or dbm for cache
Modified: httpd/httpd/trunk/docs/manual/mod/mod_cache.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_cache.xml?rev=1407381&r1=1407380&r2=1407381&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_cache.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_cache.xml Fri Nov 9 08:44:08 2012
@@ -855,13 +855,15 @@ LastModified date.
for the given URL space.
In a minimal configuration the following directive is all that is needed to
- enable the thundering herd lock in the default system temp directory.
+ enable the thundering herd lock in the default run-time file directory.
# Enable cache lock
CacheLock on
+ Locks consist of empty files that only exist for stale URLs in flight, so this
+ is significantly less resource intensive than the traditional disk cache.
@@ -869,17 +871,15 @@ CacheLock on
CacheLockPath
Set the lock path directory.
CacheLockPath directory
-CacheLockPath /tmp/mod_cache-lock
+CacheLockPath mod_cache-lock
server configvirtual host
The CacheLockPath directive allows you to specify the
- directory in which the locks are created. By default, the system's temporary
- folder is used. Locks consist of empty files that only exist for stale URLs
- in flight, so is significantly less resource intensive than the traditional
- disk cache.
-
+ directory in which the locks are created. If directory is not an absolute
+ path, the location specified will be relative to the value of
+ DefaultRuntimeDir.
Modified: httpd/httpd/trunk/modules/cache/cache_util.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_util.h?rev=1407381&r1=1407380&r2=1407381&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_util.h (original)
+++ httpd/httpd/trunk/modules/cache/cache_util.h Fri Nov 9 08:44:08 2012
@@ -95,7 +95,7 @@ extern "C" {
#define DEFAULT_X_CACHE 0
#define DEFAULT_X_CACHE_DETAIL 0
#define DEFAULT_CACHE_STALE_ON_ERROR 1
-#define DEFAULT_CACHE_LOCKPATH "/mod_cache-lock"
+#define DEFAULT_CACHE_LOCKPATH "mod_cache-lock"
#define CACHE_LOCKNAME_KEY "mod_cache-lockname"
#define CACHE_LOCKFILE_KEY "mod_cache-lockfile"
#define CACHE_CTX_KEY "mod_cache-ctx"
Modified: httpd/httpd/trunk/modules/cache/mod_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_cache.c?rev=1407381&r1=1407380&r2=1407381&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_cache.c Fri Nov 9 08:44:08 2012
@@ -1801,7 +1801,6 @@ static void *merge_dir_config(apr_pool_t
static void * create_cache_config(apr_pool_t *p, server_rec *s)
{
- const char *tmppath;
cache_server_conf *ps = apr_pcalloc(p, sizeof(cache_server_conf));
/* array of URL prefixes for which caching is enabled */
@@ -1824,10 +1823,7 @@ static void * create_cache_config(apr_po
ps->ignore_session_id_set = CACHE_IGNORE_SESSION_ID_UNSET;
ps->lock = 0; /* thundering herd lock defaults to off */
ps->lock_set = 0;
- apr_temp_dir_get(&tmppath, p);
- if (tmppath) {
- ps->lockpath = apr_pstrcat(p, tmppath, DEFAULT_CACHE_LOCKPATH, NULL);
- }
+ ps->lockpath = ap_runtime_dir_relative(p, DEFAULT_CACHE_LOCKPATH);
ps->lockmaxage = apr_time_from_sec(DEFAULT_CACHE_MAXAGE);
ps->x_cache = DEFAULT_X_CACHE;
ps->x_cache_detail = DEFAULT_X_CACHE_DETAIL;
@@ -2202,7 +2198,7 @@ static const char *set_cache_lock_path(c
(cache_server_conf *)ap_get_module_config(parms->server->module_config,
&cache_module);
- conf->lockpath = ap_server_root_relative(parms->pool, arg);
+ conf->lockpath = ap_runtime_dir_relative(parms->pool, arg);
if (!conf->lockpath) {
return apr_pstrcat(parms->pool, "Invalid CacheLockPath path ",
arg, NULL);
@@ -2380,8 +2376,8 @@ static const command_rec cache_cmds[] =
"Enable or disable the thundering herd lock."),
AP_INIT_TAKE1("CacheLockPath", set_cache_lock_path, NULL, RSRC_CONF,
"The thundering herd lock path. Defaults to the '"
- DEFAULT_CACHE_LOCKPATH "' directory in the system "
- "temp directory."),
+ DEFAULT_CACHE_LOCKPATH "' directory relative to the "
+ "DefaultRuntimeDir setting."),
AP_INIT_TAKE1("CacheLockMaxAge", set_cache_lock_maxage, NULL, RSRC_CONF,
"Maximum age of any thundering herd lock."),
AP_INIT_FLAG("CacheHeader", set_cache_x_cache, NULL, RSRC_CONF | ACCESS_CONF,