Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About cancelling client request #134

Open
rastermechanism opened this issue Sep 25, 2024 · 5 comments
Open

About cancelling client request #134

rastermechanism opened this issue Sep 25, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@rastermechanism
Copy link

Hello, I have a query, is it possible to cancel the ongoing convert request on client side.

Here is the full scenario, I am using unosever client to send request for conversion to a remote server which is docker contaner. Further I am using fastapi to make this conversion to look like REST api. So basically from fastapi I am initiating convert request to remote container, However if conversion is taking too much time, like more than 10 secondfs, I want to timeout and return the response as timeout, which I have managed using asyncio, However real request was not cancel though response has been return from REST API. What actually I want to cancel the ongoing client request to remote unoserver, gracefully and cleanup any client side mess, before returning the response. how to do that? Any help would be much appreciated.

@regebro
Copy link
Member

regebro commented Sep 25, 2024

I don't think that's possible, I'm not aware of any mechanism to get LibreOffice to stop loading or exporting a document, which is what is happening in the background.

@rastermechanism
Copy link
Author

rastermechanism commented Sep 25, 2024

@regebro thanks for the speedy reply, may be in future I will deep dive with LibreOffice, for now will use defer cleanup mechanism from Fastapi. Beside I have observed if bridge is down docker container still showing healthy and any incoming request just hangsup for infinite time. Try to add some health check mechanism which I have added using healthcheck.sh its just a small file script which checks if socket is still open at 2002 and if it fails more than 3 times restart the contaner. I think this feature will add little bit fault tolerance, though not supported natively in docker and we dont want to use swarn. But still a small utility will help a lot to the community.

Thanks

@regebro
Copy link
Member

regebro commented Sep 25, 2024

Yeah, I think in the case of stuck conversions, which sometimes happens, some way of killing LibreOffice and restarting it must happen.

@regebro
Copy link
Member

regebro commented Oct 10, 2024

Unfortunately, I can't find any way of doing this. I can add a timeout, and kill the Libreoffice process, but somehow the Libreoffice process does not stop until after it finishes the conversion.

@regebro regebro added the enhancement New feature or request label Oct 10, 2024
@regebro
Copy link
Member

regebro commented Oct 11, 2024

So, I actually did find a solution today, and 3.0b1 is released with a --conversion-timeout argument to unoserver, that will cause unoserver to terminate Libreoffice and exit after a certain time. Please test!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants