From 4bf67bcf0de2d370f0b04d8df236d30466b91598 Mon Sep 17 00:00:00 2001 From: Yiru Tang Date: Wed, 28 Sep 2022 17:10:42 +0000 Subject: [PATCH] feat: add more retry error code to the sample (#1805) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add more retry error code to the sample * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../example/bigquerystorage/WriteToDefaultStream.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquerystorage/WriteToDefaultStream.java b/samples/snippets/src/main/java/com/example/bigquerystorage/WriteToDefaultStream.java index 5cd39ed4d1..3e74e84694 100644 --- a/samples/snippets/src/main/java/com/example/bigquerystorage/WriteToDefaultStream.java +++ b/samples/snippets/src/main/java/com/example/bigquerystorage/WriteToDefaultStream.java @@ -94,9 +94,15 @@ private static class AppendContext { private static class DataWriter { - private static final int MAX_RETRY_COUNT = 2; + private static final int MAX_RETRY_COUNT = 3; private static final ImmutableList RETRIABLE_ERROR_CODES = - ImmutableList.of(Code.INTERNAL, Code.ABORTED, Code.CANCELLED); + ImmutableList.of( + Code.INTERNAL, + Code.ABORTED, + Code.CANCELLED, + Code.FAILED_PRECONDITION, + Code.DEADLINE_EXCEEDED, + Code.UNAVAILABLE); // Track the number of in-flight requests to wait for all responses before shutting down. private final Phaser inflightRequestCount = new Phaser(1);