diff options
author | Tristan Maat <tristan.maat@codethink.co.uk> | 2019-11-29 14:58:41 +0000 |
---|---|---|
committer | Tristan Maat <tristan.maat@codethink.co.uk> | 2019-11-29 14:58:41 +0000 |
commit | 80ca66134d2a8c07b084a9625b8efeb54677f821 (patch) | |
tree | 14b2834e813770f1720a18823b5098188028f5f0 | |
parent | 5a728ddb9e19d93797aff74d4daf4e2eb4598de7 (diff) | |
download | buildstream-tlater/artifactserver-casd.tar.gz |
casremote.py: Add workaround for a buildgrid bugtlater/artifactserver-casd
When sending a FetchTreeRequest with two matching digests, the request
will fail. As a workaround for now, we simply ensure that we never do
that (and only request the digest once).
-rw-r--r-- | src/buildstream/_cas/casremote.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/buildstream/_cas/casremote.py b/src/buildstream/_cas/casremote.py index 93f4e500c..ea881124e 100644 --- a/src/buildstream/_cas/casremote.py +++ b/src/buildstream/_cas/casremote.py @@ -94,6 +94,7 @@ class _CASBatchRead: self._requests = [] self._request = None self._sent = False + self._digests = None def add(self, digest): assert not self._sent @@ -103,8 +104,20 @@ class _CASBatchRead: self._request.instance_name = self._remote.local_cas_instance_name self._requests.append(self._request) + self._digests = [] + + # FIXME: If we accidentally include the same digest in a + # request twice, we get an "Unexpected error in RPC handling" + # in remote execution with buildgrid (likely casd). + # + # Not much we can do until that bug is fixed. + # + if digest in self._digests: + return + request_digest = self._request.blob_digests.add() request_digest.CopyFrom(digest) + self._digests.append(digest) def send(self, *, missing_blobs=None): assert not self._sent |