You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2013/03/27 17:19:12 UTC
svn commit: r1461689 - in /subversion/trunk: notes/knobs
subversion/libsvn_subr/cache.c
Author: danielsh
Date: Wed Mar 27 16:19:11 2013
New Revision: 1461689
URL: http://svn.apache.org/r1461689
Log:
Allow to disable all svn_cache__t in maintainer mode via an envvar. I need
this sometimes when debugging segfaults inside FSFS.
Currently, cache writes are not affected; only cache reads are intercepted.
* notes/knobs
(SVN_X_DOES_NOT_MARK_THE_SPOT): New envvar.
* subversion/libsvn_subr/cache.c
(svn_cache__get, svn_cache__get_partial, svn_cache__iter):
If SVN_DEBUG and SVN_X_DOES_NOT_MARK_THE_SPOT, pretend the cache is empty.
Modified:
subversion/trunk/notes/knobs
subversion/trunk/subversion/libsvn_subr/cache.c
Modified: subversion/trunk/notes/knobs
URL: http://svn.apache.org/viewvc/subversion/trunk/notes/knobs?rev=1461689&r1=1461688&r2=1461689&view=diff
==============================================================================
--- subversion/trunk/notes/knobs (original)
+++ subversion/trunk/notes/knobs Wed Mar 27 16:19:11 2013
@@ -475,5 +475,10 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
Scope: 'make install-tools'
Purpose: Symlinks $prefix/bin/svnsyitf to $prefix/bin/svnmucc
+7.8 SVN_X_DOES_NOT_MARK_THE_SPOT
+
+ Scope: svn_cache__t subsystem (used by FSFS, svnserve, etc)
+ Purpose: Disable the subsystem. Requires -D SVN_DEBUG.
+
* (TODO: others)
Modified: subversion/trunk/subversion/libsvn_subr/cache.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache.c?rev=1461689&r1=1461688&r2=1461689&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache.c Wed Mar 27 16:19:11 2013
@@ -75,6 +75,10 @@ svn_cache__get(void **value_p,
/* In case any errors happen and are quelched, make sure we start
out with FOUND set to false. */
*found = FALSE;
+#ifdef SVN_DEBUG
+ if (getenv("SVN_X_DOES_NOT_MARK_THE_SPOT"))
+ return SVN_NO_ERROR;
+#endif
cache->reads++;
err = handle_error(cache,
@@ -114,6 +118,12 @@ svn_cache__iter(svn_boolean_t *completed
void *user_baton,
apr_pool_t *scratch_pool)
{
+#ifdef SVN_DEBUG
+ if (getenv("SVN_X_DOES_NOT_MARK_THE_SPOT"))
+ /* Pretend CACHE is empty. */
+ return SVN_NO_ERROR;
+#endif
+
return (cache->vtable->iter)(completed,
cache->cache_internal,
user_cb,
@@ -135,6 +145,10 @@ svn_cache__get_partial(void **value,
/* In case any errors happen and are quelched, make sure we start
out with FOUND set to false. */
*found = FALSE;
+#ifdef SVN_DEBUG
+ if (getenv("SVN_X_DOES_NOT_MARK_THE_SPOT"))
+ return SVN_NO_ERROR;
+#endif
cache->reads++;
err = handle_error(cache,