Zend certified PHP/Magento developer

Running several instances of headless libreoffice: where’s race?

I’m running libreoffice (headless) to make several hundreds of pdfs from odts. It’s too slow, so I’ve tried to run some in parallel.

SOME pdf files are generated without any error but with zero size. Running one libreoffice at a time, I never hit it; running two, often.

I’ve tried to run it as recommended with custom UserInstallation and in separate directories like

/usr/local/lib/libreoffice/program/soffice.bin "-env:UserInstallation=file:///tmp/oo.44978" --headless --convert-to pdf /tmp/oo.44978/046rEQ1Nee.odt --outdir /tmp/oo.44978

Which resulted in 100% corruption.

I’ve even tried to use different sockets

/usr/local/lib/libreoffice/program/soffice.bin --nofirststartwizard --accept="socket,host=127.0.0.1,port=53668;urp;" "-env:UserInstallation=file:///tmp/oo.53668" --headless --convert-to pdf /tmp/oo.53668/xaKag8N_3d.odt --outdir /tmp/oo.53668

With the same result

Where’s a race condition in libreoffice and how do I evade it?

LibreOffice 7.6.4.1 if that’s matter.

FreeBSD 13.2-RELEASE if that’s matter.