Skip to content

Commit

Permalink
Store transient Blob data with ByteArrayPayload
Browse files Browse the repository at this point in the history
This avoids a race condition due to sharing the same Closer instance
and unbounded growth of its Closeable Deque.  References
gaul/s3proxy#303.
  • Loading branch information
gaul committed Jul 11, 2020
1 parent 9e4c7a1 commit 8de7b69
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import com.google.common.hash.HashCode;
import com.google.common.hash.Hashing;
import com.google.common.hash.HashingInputStream;
import com.google.common.io.ByteSource;
import com.google.common.io.ByteStreams;
import com.google.common.net.HttpHeaders;

Expand Down Expand Up @@ -239,7 +238,7 @@ private Blob createUpdatedCopyOfBlobInContainer(String containerName, Blob in, b
checkNotNull(in, "blob");
checkNotNull(input, "input");
checkNotNull(contentMd5, "contentMd5");
Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(input));
Payload payload = Payloads.newByteArrayPayload(input);
MutableContentMetadata oldMd = in.getPayload().getContentMetadata();
HttpUtils.copy(oldMd, payload.getContentMetadata());
payload.getContentMetadata().setContentMD5(contentMd5);
Expand Down

0 comments on commit 8de7b69

Please sign in to comment.