reuvenlax commented on code in PR #28050:
URL: https://github.com/apache/beam/pull/28050#discussion_r1379486984


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java:
##########
@@ -663,7 +663,16 @@ long flush(
                   retrieveErrorDetails(contexts));
               failedContext.failureCount += 1;
 
-              invalidateWriteStream();
+              Throwable error = 
Preconditions.checkStateNotNull(failedContext.getError());
+              Status.Code statusCode = Status.fromThrowable(error).getCode();
+              boolean quotaError = 
statusCode.equals(Status.Code.RESOURCE_EXHAUSTED);
+
+              if (!quotaError) {
+                // This forces us to close and reopen all gRPC connections to 
Storage API on error,
+                // which empirically
+                // fixes random stuckness issues.

Review Comment:
   done



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java:
##########
@@ -663,7 +663,16 @@ long flush(
                   retrieveErrorDetails(contexts));
               failedContext.failureCount += 1;
 
-              invalidateWriteStream();
+              Throwable error = 
Preconditions.checkStateNotNull(failedContext.getError());

Review Comment:
   done



-- 
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