subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1150368 - in /subversion/trunk/subversion/libsvn_client: commit.c commit_util.c
Date Sun, 24 Jul 2011 13:50:45 GMT
Author: rhuijben
Date: Sun Jul 24 13:50:44 2011
New Revision: 1150368

URL: http://svn.apache.org/viewvc?rev=1150368&view=rev
Log:
Clear iterpools in two error conditions during commit to avoid deleting files
with open handles when aborting fs transactions.

The txdelta part of this patch looks like a small regression introduced by
switching from subpools to dual pool handling.

* subversion/libsvn_client/commit.c
  (svn_client_commit5): Clear iterpool before aborting the edit to flush the
    most commonly passed scratch pool to the commit processing. This to avoid
    possible similar problems as that caught in svn_client__do_commit.

* subversion/libsvn_client/commit_util.c
  (svn_client__do_commit): Clear iterpool when svn_wc_transmit_text_deltas3
    fails. The txdelta infrastructure doesn't have a well defined abort
    procedure so the current implementations rely on pool cleanup.
    But when iterpool isn't cleared here we call the editor's abort before
    this cleanup runs.

Modified:
    subversion/trunk/subversion/libsvn_client/commit.c
    subversion/trunk/subversion/libsvn_client/commit_util.c

Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=1150368&r1=1150367&r2=1150368&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Sun Jul 24 13:50:44 2011
@@ -1451,6 +1451,7 @@ svn_client_commit5(const apr_array_heade
 
  cleanup:
   /* Abort the commit if it is still in progress. */
+  svn_pool_clear(iterpool); /* Close open handles before aborting */
   if (commit_in_progress)
     cmt_err = svn_error_compose_create(cmt_err,
                                        editor->abort_edit(edit_baton, pool));

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1150368&r1=1150367&r2=1150368&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Sun Jul 24 13:50:44 2011
@@ -1845,11 +1845,14 @@ svn_client__do_commit(const char *base_u
                                          result_pool, iterpool);
 
       if (err)
-        return svn_error_trace(fixup_commit_error(item->path,
-                                                  base_url,
-                                                  item->session_relpath,
-                                                  svn_node_file,
-                                                  err, ctx, iterpool));
+        {
+          svn_pool_destroy(iterpool); /* Close tempfiles */
+          return svn_error_trace(fixup_commit_error(item->path,
+                                                    base_url,
+                                                    item->session_relpath,
+                                                    svn_node_file,
+                                                    err, ctx, scratch_pool));
+        }
 
       if (md5_checksums)
         apr_hash_set(*md5_checksums, item->path, APR_HASH_KEY_STRING,



Mime
View raw message