summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-07-24 09:59:41 +0200
committerDarius Makovsky <traveltissues@protonmail.com>2019-08-19 12:27:55 +0100
commit174e2021b41209c72d3d19e02e55948adb50fc43 (patch)
tree6aed8da36e381faec5fd16f32d66b6676193e96b
parent0b8e38d3ce7766eb5ad65bbd5cbf162e7ea28f81 (diff)
downloadbuildstream-174e2021b41209c72d3d19e02e55948adb50fc43.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()))