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.31k stars 1.96k forks source link

[BUG] Azure Cosmos DB GlobalEndpointManager should not retry on 401 and 403 #21935

Open j82w opened 3 years ago

j82w commented 3 years ago

Describe the bug The current GlobalEndpointManager will retry on the secondary regions for all failures. In the case a unauthorized or forbidden exception it should just return the exception instead of trying secondary regions.

https://github.com/Azure/azure-sdk-for-java/blob/958a0a774d99681613db83dbe7337fab1cfdd009/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/GlobalEndpointManager.java#L96

Exception or Stack Trace Add the exception log and stack trace if available

To Reproduce

  1. Create a Cosmos DB SDK instance with a invalid key or an AAD admin with invalid permissions with multiple preferred regions configured.
  2. Try to do any operation. The SDK will attempt the request on all the regions instead of just failing after the first one.

Expected behavior The Cosmos DB SDK should not retry on secondary regions if a non-retriable exception is hit.

The .NET fix: https://github.com/Azure/azure-cosmos-dotnet-v3/pull/2511

kushagraThapar commented 3 years ago

@xinlian12 - can you please port this fix to Java SDK ?

kushagraThapar commented 1 year ago

@jeet1995 pls take a look at this, thanks!

github-actions[bot] commented 5 months ago

Hi @j82w, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

tvaron3 commented 5 months ago

Our team is planning on getting to this issue.