nextcloud / nextcloud/previewgenerator

Add a timeout to preview generator.

Open
#489 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
520
Forks
55
PR merge metrics
No merged PRs in 30d

Description

It looks like i have a file, or other users (it's a txt file), where preview generator hangs forever.

Is it possible to add a simple timeout, so that previewgenerator doesn't hang forever to wait for the file?
Im using Previewgenerator in the Combination with Imaginary, but it seems that previewgenerator hangs itself, not imaginary.

generate-all hangs forever after this line:
Generating previews for /joerg.mustermann/files/test/audi Q3 code.txt

I would assume that particular file is fine, since that would still send it to imaginary, but according to "LSOF" the file it hangs on uses ImageMagick locally to generate an preview image. I just cant tell which file is the problematic one, since lsof doesnt show a particular file.

So in short, a simple Configurable timeout, like 10 Seconds, should solve the issue with broken files where preview-generator hangs on.

Cheers

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the generate-all path that processes previews for the reported text file, including the ImageMagick and Imaginary generation paths. Identify where a configurable timeout can govern preview generation and verify the behavior with a file that hangs. Done means a timeout stops the stuck operation and generate-all can continue.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.