juergbi commented on code in PR #2160:
URL: https://github.com/apache/buildstream/pull/2160#discussion_r3705780701
##########
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)
Review Comment:
Looking at the gRPC Python code, we might not even need a timeout. The
internal wait function seems to make sure that the thread is not blocked for
longer than 0.1s. See
https://github.com/grpc/grpc/blob/f167d6a879e5b3223c99170663b2cc3e791ac6ad/src/python/grpcio/grpc/_common.py#L119
I haven't verified this but we may be able to call `.result()` without a
loop or timeout.
--
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]