subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1726392 - in /subversion/branches/parallel-put/subversion: libsvn_fs_fs/transaction.c libsvn_fs_x/transaction.c
Date Sat, 23 Jan 2016 12:41:31 GMT
Author: stefan2
Date: Sat Jan 23 12:41:31 2016
New Revision: 1726392

URL: http://svn.apache.org/viewvc?rev=1726392&view=rev
Log:
On the parallel-put branch:
Don't write to representation streams after closing them.

Because those streams are checksumming wrappers around other streams,
writing to them after closing them tends to "work" but it is fragile.

* subversion/libsvn_fs_fs/transaction.c
  (rep_write_contents_close): Don't prematurely close the REP_STREAM;
                              close it explicitly.

* subversion/libsvn_fs_x/transaction.c
  (rep_write_contents_close): Don't prematurely close the REP_STREAM.

Modified:
    subversion/branches/parallel-put/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/parallel-put/subversion/libsvn_fs_x/transaction.c

Modified: subversion/branches/parallel-put/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_fs_fs/transaction.c?rev=1726392&r1=1726391&r2=1726392&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_fs_fs/transaction.c Sat Jan 23 12:41:31
2016
@@ -2622,13 +2622,18 @@ rep_write_contents_close(void *baton)
     {
       svn_fs_fs__p2l_entry_t entry;
 
-      /* We want to add this new representation to the protorev file. */
+      /* We want to add this new representation to the protorev file.
+         Make sure our REP_STREAM does not get closed. */
       if (ffd->concurrent_txns)
-        SVN_ERR(svn_stream_copy3(source, b->rep_stream, NULL, NULL,
+        SVN_ERR(svn_stream_copy3(source,
+                                 svn_stream_disown(b->rep_stream,
+                                                   b->scratch_pool),
+                                 NULL, NULL,
                                  b->scratch_pool));
 
       /* Write out our cosmetic end marker. */
       SVN_ERR(svn_stream_puts(b->rep_stream, "ENDREP\n"));
+      SVN_ERR(svn_stream_close(b->rep_stream));
       SVN_ERR(allocate_item_index(&rep->item_index, b->fs, txn_id,
                                   b->rep_offset, b->scratch_pool));
 

Modified: subversion/branches/parallel-put/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/libsvn_fs_x/transaction.c?rev=1726392&r1=1726391&r2=1726392&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/parallel-put/subversion/libsvn_fs_x/transaction.c Sat Jan 23 12:41:31
2016
@@ -2727,9 +2727,13 @@ rep_write_contents_close(void *baton)
       svn_fs_x__p2l_entry_t entry;
       svn_fs_x__id_t noderev_id;
 
-      /* We want to add this new representation to the protorev file. */
+      /* We want to add this new representation to the protorev file.
+         Make sure our REP_STREAM does not get closed. */
       if (ffd->concurrent_txns)
-        SVN_ERR(svn_stream_copy3(source, b->rep_stream, NULL, NULL,
+        SVN_ERR(svn_stream_copy3(source,
+                                 svn_stream_disown(b->rep_stream,
+                                                   b->local_pool),
+                                 NULL, NULL,
                                  b->local_pool));
 
       /* Write out our cosmetic end marker. */



Mime
View raw message