Skip to content

Refactor locking mechanism to use asyncio.Lock for asynchronous container initialization - #185

Merged
Chris Mullins (cleemullins) merged 1 commit into
mainfrom
users/cleemullins/CosmosDbThreading
Oct 21, 2025
Merged

Refactor locking mechanism to use asyncio.Lock for asynchronous container initialization#185
Chris Mullins (cleemullins) merged 1 commit into
mainfrom
users/cleemullins/CosmosDbThreading

Conversation

@cleemullins

Copy link
Copy Markdown
Contributor

Fixes #184

@cleemullins
Chris Mullins (cleemullins) requested a review from a team as a code owner October 20, 2025 22:19
Copilot AI review requested due to automatic review settings October 20, 2025 22:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the locking mechanism in CosmosDBStorage from threading.Lock to asyncio.Lock to properly support asynchronous container initialization, addressing issue #184.

Key Changes:

  • Replaced threading.Lock with asyncio.Lock for thread-safe asynchronous operations
  • Updated lock acquisition syntax from with to async with to match asyncio patterns
  • Updated inline comment to reflect asynchronous context

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@cleemullins
Chris Mullins (cleemullins) merged commit 735164d into main Oct 21, 2025
10 checks passed
@cleemullins
Chris Mullins (cleemullins) deleted the users/cleemullins/CosmosDbThreading branch October 21, 2025 20:42
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.

Concurrency locking issue in CosmosDB Storage Provider

3 participants