summaryrefslogtreecommitdiff
path: root/src/buildstream/_sourcecache.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-10-09 15:37:17 +0100
committerBenjamin Schubert <contact@benschubert.me>2019-10-09 16:33:01 +0100
commit91c9b2a1313b70b10ba68090d94e2ff72c76fe6b (patch)
tree19d75ce30d3a6fc0537c729565032b0b5b7c29e2 /src/buildstream/_sourcecache.py
parent611deb8040caa6e88e421b3a9067dd8eea3d292f (diff)
downloadbuildstream-bschubert/partial-source-cache.tar.gz
_sourcecache: Fallback to fetch source when remote has missing blobsbschubert/partial-source-cache
If a remote has some missing blobs for a source, we should not fail abruptly but instead continue to the next remote, and, in the worst case, fetch the source again.
Diffstat (limited to 'src/buildstream/_sourcecache.py')
-rw-r--r--src/buildstream/_sourcecache.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buildstream/_sourcecache.py b/src/buildstream/_sourcecache.py
index 03ba9a74c..b987d9b8d 100644
--- a/src/buildstream/_sourcecache.py
+++ b/src/buildstream/_sourcecache.py
@@ -21,6 +21,7 @@ import os
import grpc
from ._remote import BaseRemote
+from ._cas.casremote import BlobNotFound
from .storage._casbaseddirectory import CasBasedDirectory
from ._basecache import BaseCache
from ._exceptions import CASError, CASRemoteError, SourceCacheError
@@ -259,6 +260,10 @@ class SourceCache(BaseCache):
source.info("Pulled source {} <- {}".format(display_key, remote))
return True
+ except BlobNotFound as e:
+ # Not all blobs are available on this remote
+ source.info("Remote cas ({}) does not have blob {} cached".format(remote, e.blob))
+ continue
except CASError as e:
raise SourceCacheError("Failed to pull source {}: {}".format(
display_key, e)) from e