Project

General

Profile

Actions

Defect #37530

open

Generating a thumbnail may take a long time and cause Redmine to hang

Added by Go MAEDA over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Attachments
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

When Redmine::Thumbnail.generate generates thumbnails, some input files can take a very long time to generate thumbnails, causing Redmine to hang.

Today, in my environment, Redmine tried to generate a thumbnail for a particular PDF file and it took almost an hour (3,521,455ms) and finally raised an error. Because there were multiple accesses to the issue with the PDF attached, all processes of Redmine were occupied with the generation of a thumbnail. As the result, all other requests were not accepted and users could not see any page of Redmine.

Creating thumbnail failed (`convert /*****/*****.pdf[0] -thumbnail 100x100> png:-` failed with error:
convert-im6.q16: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3229
):
Completed 404 Not Found in 3521455ms (ActiveRecord: 13.3ms | Allocations: 27136)

The attached patch sets the timeout of convert command to 10 seconds to prevent similar problems from occurring.


Files

convert-timeout.patch (1.33 KB) convert-timeout.patch Go MAEDA, 2022-07-29 11:27
Actions #1

Updated by Marius BÄ‚LTEANU over 1 year ago

  • Target version set to Candidate for next major release

I think we should log the timeouts and make the timeout configurable.

Actions

Also available in: Atom PDF