Add Assertion to Ensure Retries in S3BlobContainer (#45224) (#45230)

* We need a `markSupported` input stream to retry uploads
* Relates #45153
This commit is contained in:
Armin Braun 2019-08-06 16:11:19 +02:00 committed by GitHub
parent 772ce1f599
commit 5d7fafec14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,6 +99,7 @@ class S3BlobContainer extends AbstractBlobContainer {
*/
@Override
public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException {
assert inputStream.markSupported() : "No mark support on inputStream breaks the S3 SDK's ability to retry requests";
SocketAccess.doPrivilegedIOException(() -> {
if (blobSize <= blobStore.bufferSizeInBytes()) {
executeSingleUpload(blobStore, buildKey(blobName), inputStream, blobSize);