Skip to content

Commit 1126cdc

Browse files
authored
fix: fix createFrom resumable upload retry offset calculation (#2771)
Fixes #2770
1 parent d88c9e8 commit 1126cdc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ public Blob createFrom(BlobInfo blobInfo, Path path, int bufferSize, BlobWriteOp
270270
getOptions().asRetryDependencies(),
271271
retryAlgorithmManager.idempotent(),
272272
jsonResumableWrite);
273-
HttpContentRange contentRange =
274-
HttpContentRange.of(ByteRangeSpec.relativeLength(0L, size), size);
273+
HttpContentRange contentRange = HttpContentRange.of(ByteRangeSpec.explicit(0L, size), size);
275274
ResumableOperationResult<StorageObject> put =
276275
session.put(RewindableContent.of(path), contentRange);
277276
// all exception translation is taken care of down in the JsonResumableSession
@@ -1724,8 +1723,7 @@ public BlobInfo internalCreateFrom(Path path, BlobInfo info, Opts<ObjectTargetOp
17241723
getOptions().asRetryDependencies(),
17251724
retryAlgorithmManager.idempotent(),
17261725
jsonResumableWrite);
1727-
HttpContentRange contentRange =
1728-
HttpContentRange.of(ByteRangeSpec.relativeLength(0L, size), size);
1726+
HttpContentRange contentRange = HttpContentRange.of(ByteRangeSpec.explicit(0L, size), size);
17291727
ResumableOperationResult<StorageObject> put =
17301728
session.put(RewindableContent.of(path), contentRange);
17311729
// all exception translation is taken care of down in the JsonResumableSession

0 commit comments

Comments
 (0)