Skip to content

Commit

Permalink
chore: add UUID to retry logging (#1581)
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinWhaite committed Sep 17, 2021
1 parent e788510 commit e384f5a
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -26,6 +26,7 @@
import com.google.api.gax.retrying.TimedRetryAlgorithm;
import com.google.api.gax.retrying.TimedRetryAlgorithmWithContext;
import java.util.Iterator;
import java.util.UUID;
import java.util.concurrent.CancellationException;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand All @@ -40,6 +41,7 @@ public class BigQueryRetryAlgorithm<ResponseT> extends RetryAlgorithm<ResponseT>
private final TimedRetryAlgorithmWithContext timedAlgorithmWithContext;

private static final Logger LOG = Logger.getLogger(BigQueryRetryAlgorithm.class.getName());
private static final UUID RETRY_UUID = UUID.randomUUID();

public BigQueryRetryAlgorithm(
ResultRetryAlgorithm<ResponseT> resultAlgorithm,
Expand Down Expand Up @@ -76,13 +78,14 @@ public boolean shouldRetry(
if (LOG.isLoggable(Level.FINEST)) {
LOG.log(
Level.FINEST,
"Retrying with:\n{0}\n{1}\n{2}\n{3}\n{4}",
"Retrying with:\n{0}\n{1}\n{2}\n{3}\n{4}\n{5}",
new Object[] {
"BigQuery attemptCount: " + attemptCount,
"BigQuery delay: " + retryDelay,
"BigQuery retriableException: " + previousThrowable,
"BigQuery shouldRetry: " + shouldRetry,
"BigQuery previousThrowable.getMessage: " + errorMessage
"BigQuery previousThrowable.getMessage: " + errorMessage,
"BigQuery retry identifier: " + RETRY_UUID
});
}
return shouldRetry;
Expand Down

0 comments on commit e384f5a

Please sign in to comment.