Skip to content

Conversation

@FabianMeiswinkel
Copy link
Member

Pull Request Template

Description

When cross-region hedging is enabled in the Azure Cosmos DB .NET SDK, users experience high CPU usage or InvalidOperationExceptions ue to thread safety issues when accessing dictionaries in the Trace class. The issue occurs in the AddOrUpdateDatum method where multiple parallel threads attempt to update the same dictionary without proper synchronization.

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)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

Closing issues

To automatically close an issue: closes #IssueNumber

Copilot AI and others added 13 commits August 1, 2025 19:25
Since isBeingWalked flag prevents modifications during enumeration, snapshot methods are no longer needed. The trace system now uses direct enumeration with walking state protection instead of creating copies.

Co-authored-by: kirankumarkolli <[email protected]>
… adjust assignment order

Co-authored-by: kirankumarkolli <[email protected]>
…as started - but instead just operate on cloned snapshots
@FabianMeiswinkel
Copy link
Member Author

Closing this - opened #5361 instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants