-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
When calling BlobBatchClient.submitBatchWithResponse() containing a batch of deletions, throws the NPE below. This does not always happen, maybe 10% of the time.
Exception or Stack Trace
java.lang.NullPointerException
at com.azure.storage.blob.batch.BlobBatch.getContentLength(BlobBatch.java:339)
at com.azure.storage.blob.batch.BlobBatchAsyncClient.submitBatchWithResponse(BlobBatchAsyncClient.java:120)
at com.azure.storage.blob.batch.BlobBatchClient.submitBatchWithResponse(BlobBatchClient.java:87)
at com.github.ambry.cloud.azure.BatchBlobDeletionTest.purgeBlobs(BatchBlobDeletionTest.java:126)
at com.github.ambry.cloud.azure.BatchBlobDeletionTest.testBatchDeletion(BatchBlobDeletionTest.java:113)
at com.github.ambry.cloud.azure.BatchBlobDeletionTest.main(BatchBlobDeletionTest.java:66)
To Reproduce
Run the attached main class (executes in a loop) until the exception occurs.
Code Snippet
BlobBatch blobBatch = blobBatchClient.getBlobBatch();
List responseList = new ArrayList<>();
for (String blobName : blobNames) {
responseList.add(blobBatch.deleteBlob(containerName, blobName));
}
int purgeCount = 0;
blobBatchClient.submitBatchWithResponse(blobBatch, false, Duration.ofHours(1), Context.NONE);
Expected behavior
Expect the call to succeed.
Screenshots
N/A
Setup (please complete the following information):
- OS: MacOS 10.15.2
- IDE : IntelliJ
- Version of the Library used: azure-storage-blob-12.0.0.jar
Additional context
Need to supply program with system property azure.storage.connection.string pointing to your Azure storage account.
Note: The same program sometimes fails with UnsupportedOperationException. (See issue #7255.)
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [ x] Bug Description Added
- [ x] Repro Steps Added
- [x ] Setup information Added