gtristan commented on code in PR #1645:
URL: https://github.com/apache/buildstream/pull/1645#discussion_r867328152
##########
src/buildstream/_sourcecache.py:
##########
@@ -240,7 +240,9 @@ def _pull_source(self, source_ref, remote):
except grpc.RpcError as e:
if e.code() != grpc.StatusCode.NOT_FOUND:
- raise SourceCacheError("Failed to pull source with status {}:
{}".format(e.code().name, e.details()))
Review Comment:
Here we are again in `self._pull_source()`, also related to the previous
comments in `SourceCache.pull()`.
Here we are handling `grpc.RpcError` in response to
`AssetRemote.fetch_directory()`, however `AssetRemote.fetch_directory()`
_already handles `grpc.RpcError` and raises `AssetCacheError`_, it is not
possible to catch a `grpc.RpcError` in this code block.
As mentioned in my comment in `SourceCache.pull()`, we should:
* Have a more isolated `try` block specifically around
`AssetRemote.fetch_directory()`
* Raise the temporary `SourceCacheError` here, in response to
`AssetRemoteError`
--
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]