chamikaramj commented on a change in pull request #12295:
URL: https://github.com/apache/beam/pull/12295#discussion_r456702667



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java
##########
@@ -401,11 +401,9 @@ public Job getJob(JobReference jobRef, Sleeper sleeper, 
BackOff backoff)
     private static final FluentBackoff INSERT_BACKOFF_FACTORY =
         
FluentBackoff.DEFAULT.withInitialBackoff(Duration.millis(200)).withMaxRetries(5);
 
-    // A backoff for rate limit exceeded errors. Retries forever.
+    // A backoff for rate limit exceeded errors. Only retry upto approximately 
2 minutes.

Review comment:
       Probably add a comment as to why we are limiting this.

##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java
##########
@@ -811,7 +809,11 @@ public void deleteDataset(String projectId, String 
datasetId)
                                   "BigQuery insertAll error, retrying: %s",
                                   
ApiErrorExtractor.INSTANCE.getErrorMessage(e)));
                           try {
-                            sleeper.sleep(backoff1.nextBackOffMillis());
+                            long nextBackOffMillis = 
backoff1.nextBackOffMillis();
+                            if (nextBackOffMillis == BackOff.STOP) {
+                              throw e;

Review comment:
       Can we add a unit test for this behavior ?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to