From 176abfcd0d68ee833446b8e41a4740adad899c82 Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Tue, 10 Sep 2019 16:06:03 +0100 Subject: [cascache] Check whether local casd is dead when grpc returns UNAVAILABLE This gives a better reporting for when buildbox casd is not available locally. --- src/buildstream/_cas/cascache.py | 5 +++++ 1 file changed, 5 insertions(+) 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: -- cgit v1.2.1