[ARVADOS] updated: d4f15342fcaabb0bec0165b2abdf040c88c08229

git at public.curoverse.com git at public.curoverse.com
Wed Sep 23 08:16:44 EDT 2015


Summary of changes:
 sdk/python/arvados/arvfile.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

       via  d4f15342fcaabb0bec0165b2abdf040c88c08229 (commit)
      from  16edd7c54ac58cda991d3e9f0a1b48cea3dd985c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit d4f15342fcaabb0bec0165b2abdf040c88c08229
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue Sep 22 16:58:21 2015 -0400

    7225: Better exception handling for unexpected state changes.

diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py
index b17d547..0326608 100644
--- a/sdk/python/arvados/arvfile.py
+++ b/sdk/python/arvados/arvfile.py
@@ -564,11 +564,17 @@ class _BlockManager(object):
             # Mark the block as PENDING so to disallow any more appends.
             block.set_state(_BufferBlock.PENDING)
         except StateChangeError as e:
-            if e.state == _BufferBlock.PENDING and sync:
-                block.wait_for_commit.wait()
-                if block.state() == _BufferBlock.ERROR:
-                    raise block.error
-            return
+            if e.state == _BufferBlock.PENDING:
+                if sync:
+                    block.wait_for_commit.wait()
+                else:
+                    return
+            if block.state() == _BufferBlock.COMMITTED:
+                return
+            elif block.state() == _BufferBlock.ERROR:
+                raise block.error
+            else:
+                raise
 
         if sync:
             try:

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list