10315: Moved conditional on pending write size checking
authorLucas Di Pentima <lucas@curoverse.com>
Fri, 28 Oct 2016 18:33:03 +0000 (15:33 -0300)
committerLucas Di Pentima <lucas@curoverse.com>
Fri, 28 Oct 2016 18:33:03 +0000 (15:33 -0300)
sdk/python/arvados/arvfile.py

index 7ee028db2a219e3d9a6f6c65314fb60273412002..610fd7dc1317b6f0a6af7672d148766dbf9ce961 100644 (file)
@@ -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: