fix(analysis): hold the OCR permit for the full blocking inference
The OCR dispatcher acquired a borrowed semaphore permit, then ran the CPU-bound inference in `spawn_blocking`. On cancellation (graceful shutdown) the future dropped the permit while the detached blocking task kept running, briefly oversubscribing the blocking pool past ANALYSIS_WORKERS. Extract `run_ocr_blocking`, which acquires an *owned* permit and moves it into the blocking task so the concurrency slot's lifetime matches the actual work. Covered by a cancellation-invariant test asserting the permit stays held after the caller future is aborted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2
backend/Cargo.lock
generated
2
backend/Cargo.lock
generated
@@ -1558,7 +1558,7 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
|
||||
|
||||
[[package]]
|
||||
name = "mangalord"
|
||||
version = "0.93.5"
|
||||
version = "0.93.6"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"argon2",
|
||||
|
||||
Reference in New Issue
Block a user