LibreOffice DOCX/PPTX/XLSX conversions have no timeout and share a colliding user profile
Bug
The LibreOffice-backed conversions used for DOCX DrawingML objects, PPTX chart rendering, and XLSX EMF/WMF images have two related problems:
-
The shared
get_docx_to_pdf_converter()helper (docling/backend/docx/drawingml/utils.py), used by the DOCX and PPTX backends, callssoffice --headless --convert-to pdfwith notimeout. A hung LibreOffice process (e.g. a modal dialog it can't show in headless mode, or a malformed input) blocks the calling thread forever. -
MsExcelDocumentBackendduplicates the same subprocess call independently, with its own 60s timeout — better, but neither implementation passes-env:UserInstallation. LibreOffice takes an exclusive lock on its default user profile directory, so when two conversions run concurrently (parallel Docling workers, docling-serve handling simultaneous requests, or a job that touches DOCX+XLSX+PPTX content at once), the secondsofficeinvocation can fail to acquire the lock and the conversion fails intermittently and silently (the image/chart is just skipped).
Steps to reproduce
- Run two documents that each contain LibreOffice-dependent content (DrawingML objects, EMF/WMF images, or native charts) through Docling concurrently — e.g. two worker processes, or docling-serve handling 2 simultaneous requests.
- Observe that one conversion hangs (DOCX/PPTX path, no timeout) or silently drops the affected image/chart (profile lock contention).
Expected
Every LibreOffice invocation should be bounded by a timeout and use an isolated profile directory so concurrent conversions can't interfere with each other.
Docling version
2.113.0
Python version
3.13