fix(api): bound native PDF extraction concurrency with a semaphore
Unbounded spawn_blocking extractions let many large PDFs pile onto one pod's heap at once (each holds the <=50MB file plus parsed text/markdown), contributing to OOM kills. Bound per-process concurrency via a small FIFO semaphore (PDF_EXTRACTION_CONCURRENCY, default 3). Expose Prometheus metrics to tune the limit: - pdf_extraction_semaphore_active (gauge) - pdf_extraction_semaphore_waiting (gauge) - pdf_extraction_semaphore_wait_seconds (histogram) - pdf_extraction_semaphore_hold_seconds (histogram)
M
mogery committed
92e16a2bfb1662f73d2fe4b5cf7a7970b3c9c636
Parent: f40a10b