nextcloud / nextcloud/workflow_pdf_converter
libreoffice can hang in an infinite(?) loop
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 26
- Forks
- 8
- Avg merge
- 10h 30m
- Merged PRs (30d)
- 31
Description
Observed it with an ogg file. LibreOffice would try to treat it with the Writer import filter and just run and run and run as waste CPU cycles but don't come to an end (I waited about half an hour). Audio- and Video mimetype now are black listed, howerver I would not trust LibreOffice be working properly with other unexpected formats or perhaps corrupted files. Since the libreoffice would run, the cron job would run, too, and not finish, thus block everything.
To avoid this, we shoud switch from using exec to proc_open and friends which allow more control, for instance cancelling the process after some time. Cf. https://github.com/nextcloud/pdf_converter/blob/master/lib/BackgroundJobs/Convert.php#L87-L95
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the referenced Convert.php section in nextcloud/pdf_converter and the workflow's current LibreOffice invocation. Determine how the process can be monitored and stopped safely, then verify that a hanging or unexpectedly formatted input cannot block the cron job indefinitely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100