abderrahim commented on code in PR #2160:
URL: https://github.com/apache/buildstream/pull/2160#discussion_r3705430744


##########
src/buildstream/_cas/casremote.py:
##########
@@ -92,7 +94,16 @@ def send(self, *, missing_blobs=None):
         local_cas = self._remote.casd.get_local_cas()
 
         for request in self._requests:
-            batch_response = local_cas.FetchMissingBlobs(request)
+            batch_response_future = local_cas.FetchMissingBlobs.future(request)
+
+            try:
+                while batch_response_future.running():
+                    time.sleep(1)
+            except:
+                batch_response_future.cancel()

Review Comment:
   I am actually not sure how this works in grpc. Does the grpc asyncio API do 
things differently?
   
   I took this from the example linked from 
https://grpc.io/docs/guides/cancellation/. It noticed that it doesn't actually 
cancel the call from the buildbox-casd side, but I assumed that it would need 
some work from the buildbox-casd side.
   
   Anyway, this is something I did some time ago and wasn't very happy about 
it. I only pushed it because the discussion came up in #2157



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to