Defect #37530

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

Added by Go MAEDA 18 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Attachments
Target version:-
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.

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

Also available in: Atom PDF