mutianf commented on code in PR #30147:
URL: https://github.com/apache/beam/pull/30147#discussion_r1471690674
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java:
##########
@@ -395,7 +395,14 @@ public void onResponse(Row response) {
@Override
public void onError(Throwable t) {
- future.setException(t);
+ if (byteLimitReached) {
+ // When the byte limit is reached we cancel the stream in
onResponse.
+ // In this case we don't want to fail the request with
cancellation
+ // exception. Instead, we construct the next request.
+ onComplete();
Review Comment:
> Will there be a scenario where we have reached the byte limit, but
onComplete calls instead of onError?
I don't think so, I think the underlying client will bubble it up as a
cancellation error.
> Alternately, will there be a scenario where we have reached the byte
limit, but there is another exception?
Good point, I added an additional check to make sure the root cause is
cancellation and only reroute in that case.
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java:
##########
@@ -395,7 +395,14 @@ public void onResponse(Row response) {
@Override
public void onError(Throwable t) {
- future.setException(t);
+ if (byteLimitReached) {
+ // When the byte limit is reached we cancel the stream in
onResponse.
+ // In this case we don't want to fail the request with
cancellation
+ // exception. Instead, we construct the next request.
+ onComplete();
Review Comment:
> Will there be a scenario where we have reached the byte limit, but
onComplete calls instead of onError?
I don't think so, I think the underlying client will bubble it up as a
cancellation error.
> Alternately, will there be a scenario where we have reached the byte
limit, but there is another exception?
Good point, I added an additional check to make sure the root cause is
cancellation and only reroute in that case.
--
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]