unoconv / unoserver

MIT License
598 stars 81 forks source link

Unoconvert & unoserver hanging/freezes #50

Closed spec45as closed 1 year ago

spec45as commented 2 years ago

I ran into the following problem: I have a file that causes the process to hang/freeze unoconvert (file attached)

unoconvert --convert-to pdf '/root/4e9e29569d0b4ae09f5f52b762a83e12.jpg' '/root/4e9e29569d0b4ae09f5f52b762a83e12.pdf'

This is generally not a problem, since I have written a python wrapper/handler that interrupts unoconvert process on a timer of ~N seconds The main problem is that interrupting the unconvert command does not interrupt the unoserver process itself (freezed conversion process) and all attempts to send another file results hang too

Debug data:

LibreOffice 6.4.7.2 40(Build:2)
Python 3.8.10
unoserver==1.2

Description:    Ubuntu 20.04.5 LTS
Release:        20.04
Codename:       focal

4e9e29569d0b4ae09f5f52b762a83e12

regebro commented 2 years ago

Yes, you need to kill the server process in that situation. That's the process that got stuck. Or it's the LibreOffice that got stuck, but it should get killed with the unoserver process.

vladd-bit commented 1 year ago

I am also experiencing the same problem, it gets worse when trying to process files in parallel using the same uno server instance, also, there are certain "Unknown IO error(s)" being thrown.

regebro commented 1 year ago

The server will only convert one document at a time, having multiple clients for one server isn't going to speed anything up. If you want to process docs in parallel you need multiple servers.

regebro commented 1 year ago

I just realized, that although the extension of this file is jpg, it's actually a webm image. I think this tricks Libreoffice into thinking it's a jpg, and opening it, but then treating it as a text file. If you let it run for a few days you'd probably get a really long PDF full of random text. :-)