ComfyUI/app/assets
Luke Mino-Altherr f9d85fa176 Fix race in enqueue_enrich drain: make pending-to-start handoff atomic
Change _lock from Lock to RLock and move the start_enrich call inside the
lock-held block so that enqueue_enrich cannot interleave between clearing
_pending_enrich and starting the enrichment scan. This prevents a concurrent
enqueue_enrich from stealing the IDLE slot and causing the drained payload
to be silently dropped.

Add tests covering:
- pending enrich runs after scan completes
- enqueue during drain does not lose work
- concurrent enqueue during drain is queued for the next cycle

Amp-Thread-ID: https://ampcode.com/threads/T-019cfe02-5710-7506-ae80-34bf16c0171a
Co-authored-by: Amp <amp@ampcode.com>
2026-03-17 19:08:44 -07:00
..
api feat(assets): align local API with cloud spec (#12863) 2026-03-16 12:34:04 -07:00
database feat(assets): align local API with cloud spec (#12863) 2026-03-16 12:34:04 -07:00
services Use ExtractedMetadata in ingest_existing_file instead of passing raw dict 2026-03-17 19:08:44 -07:00
helpers.py refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
scanner.py feat(assets): register output files as assets after prompt execution 2026-03-17 19:08:44 -07:00
seeder.py Fix race in enqueue_enrich drain: make pending-to-start handoff atomic 2026-03-17 19:08:44 -07:00