From 5c05b488a1f2318e73780b67f6f654b4a12c32b3 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Fri, 28 Oct 2016 15:33:03 -0300 Subject: [PATCH] 10315: Moved conditional on pending write size checking --- sdk/python/arvados/arvfile.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py index 7ee028db2a..610fd7dc13 100644 --- a/sdk/python/arvados/arvfile.py +++ b/sdk/python/arvados/arvfile.py @@ -576,10 +576,9 @@ class _BlockManager(object): # Update the pending write size count with its true value, just in case # some small file was opened, written and closed several times. - if not force: - self._pending_write_size = sum([b.size() for b in small_blocks]) - if self._pending_write_size < config.KEEP_BLOCK_SIZE: - return + self._pending_write_size = sum([b.size() for b in small_blocks]) + if self._pending_write_size < config.KEEP_BLOCK_SIZE and not force: + return new_bb = self._alloc_bufferblock() while len(small_blocks) > 0 and (new_bb.write_pointer + small_blocks[0].size()) <= config.KEEP_BLOCK_SIZE: -- 2.30.2