Azure / Azure/azure-cosmosdb-java

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

Open
#352 0 comments 0 reactions 1 assignee Claimed by @kushagraThapar View on GitHub
bug
Dominant language
Java
Stars
59
Forks
68
PR merge metrics
No merged PRs in 30d

Description

**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](https://github.com/Azure/azure-cosmosdb-java/blob/c870cff6fe2bfcafd2120cd3c49e54d036f4d3db/gateway/src/main/java/com/microsoft/azure/cosmosdb/rx/internal/ClientRetryPolicy.java#L222)
[Which is getting use here](https://github.com/Azure/azure-cosmosdb-java/blob/c870cff6fe2bfcafd2120cd3c49e54d036f4d3db/gateway/src/main/java/com/microsoft/azure/cosmosdb/internal/routing/LocationCache.java#L178)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.