Skip to content

Commit 4161392

Browse files
Add comment to "All retries failed" exception
(comment explains how you may get a retriable exception that says "retries failed")
1 parent aba972d commit 4161392

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageReadChannel.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ public int read(ByteBuffer dst) throws IOException {
126126
} else if (exs.isRetryable() || exs.getCode() == 500 || exs.getCode() == 503) {
127127
retries++;
128128
if (retries > maxRetries) {
129+
// this exception will be marked as retriable in most cases since
130+
// it's based on the code. It may be confusing to see a retriable error
131+
// that says "all retries failed" but understand this to mean:
132+
// "While in principle you should be able to retry, we already did that
133+
// for you a few times and it still didn't work so we wouldn't recommend
134+
// further retries."
129135
throw new StorageException(exs.getCode(), "All retries failed", exs);
130136
}
131137
sleepForAttempt(retries);

0 commit comments

Comments
 (0)