Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-4157

BDB incompatible with event MPM

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • trunk
    • None
    • libsvn_fs_base
    • None

    Description

      See this thread:

      http://mail-archives.apache.org/mod_mbox/subversion-dev/201204.mbox/%3C87ty129j5h.fsf@stat.home.lan%3E
      http://svn.haxx.se/dev/archive-2012-04/0017.shtml

      The event MPM is the default MPM for Apache 2.4 having been experimental in 2.2. The event MPM is incompatible with Subversion's BDB backend.

      The problem is Subversion's per-thread BDB error handling structures. Subversion assumes that the same thread will allocate and release these structures, i.e. that the access will be by a single thread. The event MPM switches threads
      although the access is probably "one thread at a time".

      This patch causes assertion failures with the event MPM:

      Index: subversion/libsvn_fs_base/bdb/env.c
      ===================================================================
      --- subversion/libsvn_fs_base/bdb/env.c	(revision 1309593)
      +++ subversion/libsvn_fs_base/bdb/env.c	(working copy)
      @@ -186,6 +186,7 @@ get_error_info(const bdb_env_t *bdb)
         if (!priv)
           {
             priv = calloc(1, sizeof(bdb_error_info_t));
      +      ((struct bdb_error_info_t *)priv)->id = pthread_self();
             apr_threadkey_private_set(priv, bdb->error_info);
           }
         return priv;
      @@ -524,6 +525,7 @@ svn_fs_bdb__close(bdb_env_baton_t *bdb_baton)
       
         SVN_ERR_ASSERT(bdb_baton->env == bdb_baton->bdb->env);
         SVN_ERR_ASSERT(bdb_baton->error_info->refcount > 0);
      +  SVN_ERR_ASSERT(pthread_equal(bdb_baton->error_info->id, pthread_self()));
       
         /* Neutralize bdb_baton's pool cleanup to prevent double-close. See
            cleanup_env_baton(). */
      Index: subversion/libsvn_fs_base/bdb/env.h
      ===================================================================
      --- subversion/libsvn_fs_base/bdb/env.h	(revision 1309593)
      +++ subversion/libsvn_fs_base/bdb/env.h	(working copy)
      @@ -71,6 +71,8 @@ typedef struct bdb_error_info_t
            instances that refer to this object. */
         unsigned refcount;
       
      +  pthread_t id;
      +
       } bdb_error_info_t;
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              philipm Philip Martin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: