Project

General

Profile

Actions

Feature #37530

closed

Add timeout for thumbnail generation process

Added by Go MAEDA almost 2 years ago. Updated 16 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Attachments
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

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
clipboard-202405221631-vfis0.png (23.1 KB) clipboard-202405221631-vfis0.png Go MAEDA, 2024-05-22 09:31
37530-v2.patch (3.7 KB) 37530-v2.patch Go MAEDA, 2024-05-22 09:42
37530-v3.patch (3.37 KB) 37530-v3.patch Go MAEDA, 2024-05-22 13:57
37530-v4.patch (3.22 KB) 37530-v4.patch Go MAEDA, 2024-05-26 04:29
Actions

Also available in: Atom PDF