Skip to content

Fix race condition in in-memory database due to concurrent SET/DEL operations #3

Description

@steadyfall

The in-memory db map in our repository is currently not safe for concurrent use. Concurrent SET or DEL operations from multiple clients could potentially lead to race conditions, which may cause unexpected behavior or data corruption.

Steps to Reproduce

  1. Run the service with multiple clients performing write operations (SET/DEL) concurrently.
  2. Observe potential data race conditions or inconsistent application behavior.

Expected Behavior

The in-memory database should handle concurrent operations safely, ensuring that race conditions do not occur.

Proposed Fix

Add synchronization (e.g., mutex locking) around the write operations to the db map to prevent concurrent access issues.

Additional Context

Identify the functions performing write operations and apply the appropriate locking mechanism without impacting overall performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions