summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-09-10 16:06:03 +0100
committerBenjamin Schubert <contact@benschubert.me>2019-10-02 14:00:33 +0100
commit176abfcd0d68ee833446b8e41a4740adad899c82 (patch)
tree6e2097383b3f30507444a0ed1ad04b33a6cb506b
parent9f453bbc1a450de1400f77eb626ab2bc9558497c (diff)
downloadbuildstream-bschubert/casd-better-reporting.tar.gz
[cascache] Check whether local casd is dead when grpc returns UNAVAILABLEbschubert/casd-better-reporting
This gives a better reporting for when buildbox casd is not available locally.
-rw-r--r--src/buildstream/_cas/cascache.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py
index 6315c1f93..ab5e167d7 100644
--- a/src/buildstream/_cas/cascache.py
+++ b/src/buildstream/_cas/cascache.py
@@ -120,6 +120,11 @@ class CASCache():
break
except grpc.RpcError as e:
if e.code() == grpc.StatusCode.UNAVAILABLE:
+ # Either casd is not ready or it is dead
+ if self._casd_process.poll() is not None:
+ raise CASCacheError("Local buildbox-casd process died with return code: {}".format(
+ self._casd_process.returncode))
+
# casd is not ready yet, try again after a 10ms delay,
# but don't wait for more than 15s
if time.time() < self._casd_start_time + 15: