fix: harden document pipeline concurrency and diagnostics

- docreader: serialize all pdfium access behind a global lock. pypdfium2
  is process-global and not thread-safe, so concurrent PDF uploads could
  corrupt its shared state and deadlock the whole process (requests stuck
  in "Parsing document" forever). Non-PDF parsers still run concurrently.
- logger: strip ANSI color escapes from file logs so on-disk logs stay
  plain text while stdout keeps terminal colors.
- storage: log baseDir/resolvedPath on file-open failure and when the
  multimodal service resolves a file service, so a LOCAL_STORAGE_BASE_DIR
  mismatch between writer and reader is immediately visible.
- docker: set TZ (default Asia/Shanghai) for the docreader container.
This commit is contained in:
wizardchen
2026-07-09 13:24:38 +08:00
committed by lyingbug
parent d287c70358
commit b6d3420a5d
7 changed files with 63 additions and 3 deletions
+1
View File
@@ -247,6 +247,7 @@ services:
volumes:
- docreader-tmp-dev:/tmp/docreader
environment:
- TZ=${TZ:-Asia/Shanghai}
- DOCREADER_IMAGE_OUTPUT_DIR=/tmp/docreader
- DOCREADER_PDF_FORCE_SCANNED=${DOCREADER_PDF_FORCE_SCANNED:-false}
- MAX_FILE_SIZE_MB=${MAX_FILE_SIZE_MB:-}