Author: brane
Date: Fri Jan 11 00:15:16 2013
New Revision: 1431757

URL: http://svn.apache.org/viewvc?rev=1431757&view=rev
Log:
Helper code for reproducing issue #4274 (serf client hangs when server crashes).

* subversion/libsvn_repos/repos.c (get_repos): When SVN_DEBUG is defined,
   if the file $REPO_PATH/conf/debug-abort exists, crash after opening
   the repository and filesystem.

Modified:
    subversion/trunk/subversion/libsvn_repos/repos.c

Modified: subversion/trunk/subversion/libsvn_repos/repos.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/repos.c?rev=1431757&r1=1431756&r2=1431757&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/repos.c (original)
+++ subversion/trunk/subversion/libsvn_repos/repos.c Fri Jan 11 00:15:16 2013
@@ -1539,6 +1539,23 @@ get_repos(svn_repos_t **repos_p,
   if (open_fs)
     SVN_ERR(svn_fs_open(&repos->fs, repos->db_path, fs_config, pool));
 
+#ifdef SVN_DEBUG
+  /* If $PATH/config/debug-abort exists, crash the server here.
+     This debugging feature can be used to test client recovery
+     when the server crashes.
+
+     See: Issue #4274 */
+  {
+    svn_node_kind_t kind;
+    svn_error_t *err = svn_io_check_path(
+        svn_dirent_join(repos->conf_path, "debug-abort", pool),
+        &kind, pool);
+    svn_error_clear(err);
+    if (!err && kind == svn_node_file)
+      SVN_ERR_MALFUNCTION_NO_RETURN();
+  }
+#endif
+
   *repos_p = repos;
   return SVN_NO_ERROR;
 }


Reply via email to