Describe the bug
After calling BlobBatchClient.submitBatchWithResponse() containing a batch of deletions, checking the response status throws the exception below. This does not always happen, maybe 20% of the time.
Exception or Stack Trace
java.lang.UnsupportedOperationException: Batch request has not been sent.
at com.azure.storage.blob.batch.BlobBatchOperationResponse.assertResponseReceived(BlobBatchOperationResponse.java:106)
at com.azure.storage.blob.batch.BlobBatchOperationResponse.getStatusCode(BlobBatchOperationResponse.java:43)
at com.github.ambry.cloud.azure.BatchBlobDeletionTest.purgeBlobs(BatchBlobDeletionTest.java:133)
To Reproduce
Run the attached main class (executes in a loop) until the exception occurs.
Code Snippet
BlobBatch blobBatch = blobBatchClient.getBlobBatch();
List<Response> 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);
logger.debug("Batch submitted.");
for (int j = 0; j < responseList.size(); j++) {
Response response = responseList.get(j);
Expected behavior
Expect the status to be available by the time the submitBatch call returns.
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 a NullPointerException. (See #7256.)
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
BatchBlobDeletionTest.java.txt
Describe the bug
After calling BlobBatchClient.submitBatchWithResponse() containing a batch of deletions, checking the response status throws the exception below. This does not always happen, maybe 20% of the time.
Exception or Stack Trace
java.lang.UnsupportedOperationException: Batch request has not been sent.
at com.azure.storage.blob.batch.BlobBatchOperationResponse.assertResponseReceived(BlobBatchOperationResponse.java:106)
at com.azure.storage.blob.batch.BlobBatchOperationResponse.getStatusCode(BlobBatchOperationResponse.java:43)
at com.github.ambry.cloud.azure.BatchBlobDeletionTest.purgeBlobs(BatchBlobDeletionTest.java:133)
To Reproduce
Run the attached main class (executes in a loop) until the exception occurs.
Code Snippet
BlobBatch blobBatch = blobBatchClient.getBlobBatch();
List<Response> 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);
logger.debug("Batch submitted.");
for (int j = 0; j < responseList.size(); j++) {
Response response = responseList.get(j);
Expected behavior
Expect the status to be available by the time the submitBatch call returns.
Screenshots
N/A
Setup (please complete the following information):
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 a NullPointerException. (See #7256.)
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
BatchBlobDeletionTest.java.txt