Skip to content

[Concurrency] TICKETS_DB list lacks thread safety for concurrent create/update#2883

Open
sanrishi wants to merge 1 commit into
ritesh-1918:gssocfrom
sanrishi:fix/tickets-db-concurrency
Open

[Concurrency] TICKETS_DB list lacks thread safety for concurrent create/update#2883
sanrishi wants to merge 1 commit into
ritesh-1918:gssocfrom
sanrishi:fix/tickets-db-concurrency

Conversation

@sanrishi

Copy link
Copy Markdown

Target

\�ackend/routers/tickets.py: \create_ticket, \update_ticket
\�ackend/ticket_store.py\ (new)

Vector

Thread Pool Exhaustion / Concurrency

Problem

\TICKETS_DB\ was a bare Python list with unsafe iteration and mutation. Concurrent requests could bypass duplicate checks and corrupt data.

Changes

  • Created \TicketStore\ with \ hreading.RLock\ for atomic operations
  • \create_ticket\ uses \ icket_store.add()\
  • \update_ticket\ uses \ icket_store.update()\

Fixes #2870

- Add backend/ticket_store.py with RLock-based dict store
- Replace next() iteration and list mutation in create/update_ticket
- Remove TICKETS_DB import from backend.models

Fixes ritesh-1918#2870
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the ritesh Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cbc0ebf3-157d-4ca9-af48-84a4b50d4435

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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