-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
When I run the below line of code it does not return any thing(exception/logs or etc) and it exits the calling thread.
BlobServiceClient blobServiceClient = (new BlobServiceClientBuilder()).endpoint(endpoint).credential(credential).buildClient();
Means it does not come back and releases the thread.
How did I verify this? I placed the line inside a try block and added a log statement after the call, but it never threw an exception and didn’t even write the logs.
Exception or Stack Trace
No error /exception
To Reproduce
use the below code:
public BlobBatchClient getBlobBatchClient(String storageAccountName) {
log.debug("DEBUG_LOG inside getBlobBatchClient storageAccountName: {}",storageAccountName);
StorageAccount storageAccount = getStorageAccountByName(storageAccountName);
log.debug("DEBUG_LOG after getStorageAccountByName");
if (storageAccount !=null)
{
if (storageAccount.getKeys() != null)
{
log.debug("DEBUG_LOG inside getBlobBatchClient and checking keys{}",storageAccount.getKeys().get(0).value());
}
else {
log.debug("DEBUG_LOG inside getBlobBatchClient storageAccount.getKeys() is null");
}
}
else
{
log.debug("DEBUG_LOG inside getBlobBatchClient storageAccount is null");
}
String endpointString;
if (getCloudProvider() == Provider.AZURE_GOV) {
endpointString = ENDPOINTGOV_STRING;
} else
endpointString = ENDPOINT_STRING;
String endpoint = String.format(Locale.ROOT, endpointString, storageAccountName);
log.debug("DEBUG_LOG inside getBlobBatchClient endpoint{}",endpoint);
StorageSharedKeyCredential credential = new StorageSharedKeyCredential(storageAccountName, storageAccount.getKeys().get(0).value());
log.debug("DEBUG_LOG after getStorageAccountByName credential{}",credential.getAccountName());
BlobServiceClient blobServiceClient=null;
try {
----------------till this it works----------------
blobServiceClient = (new BlobServiceClientBuilder()).endpoint(endpoint).credential(credential).buildClient(); --------> when it reaches here no output and calling thread gets exit.
log.debug("DEBUG_LOG after getStorageAccountByName blobServiceClient{}", credential.getAccountName());
} catch (Exception e) {
log.debug("DEBUG_LOG inside getBlobBatchClient inside catch msg : {}",e.getMessage());
}
log.debug("DEBUG_LOG inside getBlobBatchClient before return");
return new BlobBatchClientBuilder(blobServiceClient).buildClient();
}Code Snippet
public BlobBatchClient getBlobBatchClient(String storageAccountName) {
log.debug("DEBUG_LOG inside getBlobBatchClient storageAccountName: {}",storageAccountName);
StorageAccount storageAccount = getStorageAccountByName(storageAccountName);
log.debug("DEBUG_LOG after getStorageAccountByName");
if (storageAccount !=null)
{
if (storageAccount.getKeys() != null)
{
log.debug("DEBUG_LOG inside getBlobBatchClient and checking keys{}",storageAccount.getKeys().get(0).value());
}
else {
log.debug("DEBUG_LOG inside getBlobBatchClient storageAccount.getKeys() is null");
}
}
else
{
log.debug("DEBUG_LOG inside getBlobBatchClient storageAccount is null");
}
String endpointString;
if (getCloudProvider() == Provider.AZURE_GOV) {
endpointString = ENDPOINTGOV_STRING;
} else
endpointString = ENDPOINT_STRING;
String endpoint = String.format(Locale.ROOT, endpointString, storageAccountName);
log.debug("DEBUG_LOG inside getBlobBatchClient endpoint{}",endpoint);
StorageSharedKeyCredential credential = new StorageSharedKeyCredential(storageAccountName, storageAccount.getKeys().get(0).value());
log.debug("DEBUG_LOG after getStorageAccountByName credential{}",credential.getAccountName());
BlobServiceClient blobServiceClient=null;
try {
**----------------till this it works----------------** ****
blobServiceClient = (new BlobServiceClientBuilder()).endpoint(endpoint).credential(credential).buildClient(); --------> when it reaches here no output and calling thread gets exit.
log.debug("DEBUG_LOG after getStorageAccountByName blobServiceClient{}", credential.getAccountName());
} catch (Exception e) {
log.debug("DEBUG_LOG inside getBlobBatchClient inside catch msg : {}",e.getMessage());
}
log.debug("DEBUG_LOG inside getBlobBatchClient before return");
return new BlobBatchClientBuilder(blobServiceClient).buildClient();
}Expected behavior
Calling the this line blobServiceClient = (new BlobServiceClientBuilder()).endpoint(endpoint).credential(credential).buildClient(); should return either data or null or error or exception
Screenshots
NA
Setup (please complete the following information):
- OS: [e.g. iOS] :SUSE
- IDE: [e.g. IntelliJ]
- Library/Libraries: Azure SDK
- Java version: [e.g. 8] java 17
- App Server/Environment:Azure
- Frameworks: [e.g. Spring Boot, Micronaut, Quarkus, etc] Spring Boot
- Azure-storage-common: 12.17
- Azure-storage-blob:12:30
If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:
- verbose dependency tree (
mvn dependency:tree -Dverbose) - exception message, full stack trace, and any available logs
Additional context
Add any other context about the problem here.
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
- Bug Description Added
- Repro Steps Added
- Setup information Added