Streams with prefecth_first_result do not convert grpc errors #731
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
one task of grpc_helpers is to wrap grpc channels in
error_remapped_callable
, converting grpc errors intoapi_core.exception
types. But this error remapping is skipped when processing a streaming rpc with prefetch_first enabled.When prefetch_first is enabled, the StreamingResponseIterator calls next as part of its init. But if there is an error as part of the next call, the grpc error is raised immediately, without being wrapped
Because the error is not wrapped, and it is raised outside the usual call loop, this will cause retryable errors to not be retried properly
To solve this, we should probably add a case to this try/catch:
And then raise it as part of __next__ if present here
related: b/368027810
The text was updated successfully, but these errors were encountered: