Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

In flight http request during failover not moving to other available region #352

Open simplynaveen20 opened 4 years ago

simplynaveen20 commented 4 years ago

Describe the bug During network io exception we do the region failover to other available region. All the subsequent requests goes to other region. However current request keep retrying over the same region for 120 times before floating error to user if not succeeded.

To Reproduce Have two read regions. Induce the IO exception in one region, and you will see that flight request keep retrying in same region

Expected behavior In flight request should move to other region once it mark the current region unavailable temporally

Actual behavior In flight request keep retrying in same region after marking it unavailble

Environment summary SDK Version: V2/V3/V4

Additional context This problem probably exist in .NET cosmosdb sdk too. Below is the relevant code where it keep retrying in same region. Setting retryReguestOnPreferredRegion false Which is getting use here