From 8db98fd659abfbc86f3ddb6d4135fb9c4e7a8936 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Mon, 5 Jun 2023 14:04:50 -0400 Subject: [PATCH] fix: include invocation-id for resumable PUTs Change BlobWriteChannel to us Retrying.run so it will receive an invocation id --- .../com/google/cloud/storage/BlobWriteChannel.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java index f5f7f14d74..7b19258790 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java @@ -16,7 +16,6 @@ package com.google.cloud.storage; -import static com.google.cloud.RetryHelper.runWithRetries; import static java.util.Objects.requireNonNull; import static java.util.concurrent.Executors.callable; @@ -28,6 +27,7 @@ import com.google.cloud.RetryHelper; import com.google.cloud.WriteChannel; import java.math.BigInteger; +import java.util.function.Function; import java.util.function.Supplier; import org.checkerframework.checker.nullness.qual.NonNull; @@ -186,7 +186,9 @@ private static StorageException unrecoverableState( @Override protected void flushBuffer(final int length, final boolean lastChunk) { try { - runWithRetries( + Retrying.run( + getOptions(), + algorithmForWrite, callable( new Runnable() { @Override @@ -274,9 +276,7 @@ public void run() { } } }), - getOptions().getRetrySettings(), - algorithmForWrite, - getOptions().getClock()); + Function.identity()); } catch (RetryHelper.RetryHelperException e) { throw StorageException.translateAndThrow(e); }