Skip to content

Conversation

@NaluTripician
Copy link
Contributor

@NaluTripician NaluTripician commented May 9, 2025

Pull Request Template

Description

This pull request refactors the CrossRegionHedgingAvailabilityStrategy class in the Azure Cosmos SDK to fix a rare concurrency issue regarding session tokens and improve diagnostics for improved debugging.. It also updates related tests to align with the changes. The most important changes include replacing the Response Region diagnostic with a new Hedge Config diagnostic, modifying the HedgingResponse class, and updating test cases to validate the new behavior. the Response Region field can sometimes be inaccurate with internal cross regional retries so it has been removed. To find the response region, you can look at the existing store response to see where the response came from.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)

Closing issues

To automatically close an issue: closes #IssueNumber

@NaluTripician NaluTripician self-assigned this May 9, 2025
@NaluTripician NaluTripician requested a review from khdang as a code owner May 9, 2025 16:19
@NaluTripician NaluTripician added the Hedging Any issue/feature request related to request hedging label May 9, 2025
@dibahlfi
Copy link
Contributor

dibahlfi commented May 9, 2025

I thought your previous PR
#5138, the below line introduced handled the concurrency issue. wasn't that the case or this is a differenent issue?
using (RequestMessage nonModifiedRequestClone = request.Clone(hedgingTrace, clonedBody))

@NaluTripician
Copy link
Contributor Author

I thought your previous PR #5138, the below line introduced handled the concurrency issue. wasn't that the case or this is a differenent issue? using (RequestMessage nonModifiedRequestClone = request.Clone(hedgingTrace, clonedBody))

Context: In an offline discussion we decided to only take some of the changes with that PR and create a new one.

kirankumarkolli
kirankumarkolli previously approved these changes May 9, 2025
@NaluTripician NaluTripician added the auto-merge Enables automation to merge PRs label May 9, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot enabled auto-merge (squash) May 9, 2025 20:39
@kirankumarkolli kirankumarkolli changed the title Hedging: Fixes Concurrency Issue Hedging: Fixes Concurrency Issue Clone ReqeustMessage everytime May 9, 2025
aavasthy
aavasthy previously approved these changes May 9, 2025
@NaluTripician NaluTripician changed the title Hedging: Fixes Concurrency Issue Clone ReqeustMessage everytime Hedging: Fixes Concurrency Issue May 9, 2025
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thanks!

Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@microsoft-github-policy-service microsoft-github-policy-service bot merged commit db91df0 into master May 9, 2025
26 checks passed
@microsoft-github-policy-service microsoft-github-policy-service bot deleted the users/nalutripician/hedgingConcurrency branch May 9, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enables automation to merge PRs Hedging Any issue/feature request related to request hedging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants