summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-07-24 09:59:41 +0200
committerJürg Billeter <j@bitron.ch>2019-08-20 08:09:52 +0200
commitca23e62e59bc91f38f53cd9010d82480e22e0565 (patch)
treea09a2ee9b9aa3041350b79b02611126f46cf31eb
parentcfb8901e60a03def79cbceb85fbeaadd13aa5957 (diff)
downloadbuildstream-ca23e62e59bc91f38f53cd9010d82480e22e0565.tar.gz
_artifactcache.py: Handle CASRemoteError
-rw-r--r--src/buildstream/_artifactcache.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buildstream/_artifactcache.py b/src/buildstream/_artifactcache.py
index adb3eb298..f92a7c84f 100644
--- a/src/buildstream/_artifactcache.py
+++ b/src/buildstream/_artifactcache.py
@@ -21,7 +21,7 @@ import os
import grpc
from ._basecache import BaseCache
-from ._exceptions import ArtifactError, CASError, CASCacheError
+from ._exceptions import ArtifactError, CASError, CASCacheError, CASRemoteError
from ._protos.buildstream.v2 import buildstream_pb2, buildstream_pb2_grpc, \
artifact_pb2, artifact_pb2_grpc
@@ -440,6 +440,10 @@ class ArtifactCache(BaseCache):
self.cas.send_blobs(remote, digests)
+ except CASRemoteError as cas_error:
+ if cas_error.reason != "cache-too-full":
+ raise ArtifactError("Failed to push artifact blobs: {}".format(cas_error))
+ return False
except grpc.RpcError as e:
if e.code() != grpc.StatusCode.RESOURCE_EXHAUSTED:
raise ArtifactError("Failed to push artifact blobs: {}".format(e.details()))