Skip to content

fix(ddbds): improve concurrency control and resource limits #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pranavkonde
Copy link

Improve Concurrency Control in DDBDatastore

Problem

  • Random number generator used for jitter calculations is not thread-safe
  • Batch operations lack concurrency limits, potentially overwhelming resources

Solution

  • Added mutex protection for random number generator
  • Implemented semaphore to limit concurrent batch operations
  • Improved error handling and context cancellation in batch operations
  • Added proper cleanup of resources

Changes

  • Added randMu mutex to protect random number generation
  • Introduced batchSem semaphore to limit concurrent operations
  • Enhanced batch operation error handling
  • Improved context handling in batch operations

Testing

  • Verified thread-safety of random number generation
  • Tested batch operations under high concurrency
  • Verified proper resource cleanup

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.

1 participant