#475 Race Condition: File deduplication missing ON CONFLICT

closed medium Created 2025-12-17 01:42 · Updated 2025-12-17 01:58

Description

Edit
engine/services/storage_service.py:114-131 File store deduplication has TOCTOU race: 1. Store file in S3 2. Check if storage_ref exists in DB 3. Insert if not exists Race: Two threads store same file, both check DB, both insert -> duplicate key error. FIX: Use INSERT ... ON CONFLICT (storage_ref) DO NOTHING RETURNING file_id

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...