18842: One more refactor 18842-arv-mount-disk-config
authorPeter Amstutz <peter.amstutz@curii.com>
Fri, 2 Dec 2022 16:30:43 +0000 (11:30 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 2 Dec 2022 16:30:43 +0000 (11:30 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/python/arvados/keep.py

index 8dbad2abb18aeb99a39ab896490751651c45c6b3..b9e22748c180190251a266f1d058fad039abae24 100644 (file)
@@ -346,15 +346,12 @@ class KeepBlockCache(object):
             # to free up resources, which would make the operation
             # succeed.
             slot.set(blob)
-            self.cap_cache()
         except Exception as e:
             # It failed again.  Give up.
+            slot.set(None)
             raise arvados.errors.KeepCacheError("Unable to save block %s to disk cache: %s" % (slot.locator, e))
-        finally:
-            # Set the notice that that we are done with the cache
-            # slot one way or another.
-            slot.ready.set()
 
+        self.cap_cache()
 
 class Counter(object):
     def __init__(self, v=0):