Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 1.99k forks source link

[BUG] invalid wasb credentials taking 13-14 minutes to execute #41512

Open muskaan62 opened 2 months ago

muskaan62 commented 2 months ago

Describe the bug invalid wasb credentials taking 13-14 minutes to execute. from 5.x this issue is happening. till 5.0.0 its working as expected

Exception or Stack Trace Getting correct error but it is taking time To Reproduce Steps to reproduce the behavior:

Code Snippet

   public static void main(String[] args) {
// Replace with your Azure Storage account name and key
String accountName = "";
String accountKey = "";
// Replace with the path you want to access
    String wasbPath = "";
    Configuration conf = new Configuration();
    // Set the configuration for Azure Blob Storage
    conf.set("fs.azure", "org.apache.hadoop.fs.azure.NativeAzureFileSystem");
    conf.set("fs.azure.account.key." + accountName + ".blob.core.windows.net", accountKey);
    long startTime = 0;
    try {
        startTime = System.currentTimeMillis();
        // Get the FileSystem object
        FileSystem fs = FileSystem.get(new URI(wasbPath), conf);

        // Create a Path object for the file
        Path path = new Path(wasbPath);

        // Check if the file exists
        if (fs.exists(path)) {
            // Read the file
            BufferedReader br = new BufferedReader(new InputStreamReader(fs.open(path)));
            String line;
            while ((line = br.readLine()) != null) {
                System.out.println(line);
            }
            br.close();
        } else {
            System.out.println("File does not exist");
        }

        // Close the FileSystem object
        fs.close();
    } catch (Exception e) {
        long endTime = System.currentTimeMillis();
        long executionTimeInMillis = endTime - startTime;
        double executionTimeInMinutes = executionTimeInMillis / (1000.0 * 60.0);
        System.out.println("Execution time: " + executionTimeInMinutes + " minutes");
        e.printStackTrace();
    }
}``

Expected behavior It should fail immediately Screenshots If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

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:

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

github-actions[bot] commented 2 months ago

@ibrahimrabab @ibrandes @kyleknap @seanmcc-msft

github-actions[bot] commented 2 months ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

muskaan62 commented 2 months ago

@ibrahimrabab @ibrandes @kyleknap @seanmcc-msft Just wanted to follow up on this..Any update on the reported issue pls??