unoconv / unoserver

MIT License
496 stars 69 forks source link

Concurrent conversions #9

Closed gulien closed 2 years ago

gulien commented 2 years ago

Hello 👋

Currently, with unoconv, I'm using the --user-profile and --port flags in order to handle concurrent conversions.

With unoserver, I guess I'll need to implement a sort of lock mechanism to prevent concurrent calls to unoserver.

Yet, I would still need to specify the user profile directory so that I'll be able to clean it on "force kill" (see also #8).

Would it be possible to add this flag to unoserver?

regebro commented 2 years ago

You don't need to pass in the --user-profile, unoserver creates it's own temporary profile. I don't know why you need to specify the user profile directory to kill it?

gulien commented 2 years ago

AFAIK, the temporary profile is not deleted.

In Gotenberg, I may have to kill the process, then restart it, but this will lead to more and more "temporary" profiles created over time.

As I don't know the path of the temporary profile, I cannot delete it to prevent such a scenario.

regebro commented 2 years ago

Ah, that's probably true, it won't get deleted if you kill -9 the process. But then I have to ask: Why are you constantly killing conversion processes? That's an indication that something is very wrong.

gulien commented 2 years ago

I’m not, but if a request takes more time than allowed, I cancel it and kill the process; LibreOffice may be stuck and unrecoverable if I don’t.

regebro commented 2 years ago

If it gets a sigterm it should terminate nicely and remove the temporary directory.