fix(thumbnail): add timeout protection for large image processing#229
Open
BillionClaw wants to merge 1 commit intoDioCrafts:mainfrom
Open
fix(thumbnail): add timeout protection for large image processing#229BillionClaw wants to merge 1 commit intoDioCrafts:mainfrom
BillionClaw wants to merge 1 commit intoDioCrafts:mainfrom
Conversation
Add configurable timeout for thumbnail generation to prevent hanging when processing very large images. The default timeout is 30 seconds. Changes: - Add thumbnail_generation_ms to TimeoutConfig (default: 30s) - Add generation_timeout field to ThumbnailService - Wrap spawn_blocking in tokio::time::timeout - Update DI to pass timeout from config - Update tests to provide timeout parameter
Owner
|
may fix the conflicts file ? @BillionClaw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Thumbnail generation for large images could hang indefinitely because there was no timeout protection on the
spawn_blockingcall that processes images.Solution
Add configurable timeout (default 30s) for thumbnail generation operations:
thumbnail_generation_mstoTimeoutConfigwith 30 second defaultgeneration_timeoutfield toThumbnailServicespawn_blockingcall intokio::time::timeoutto prevent hangingTesting
cargo check --libpassesRelated
This fix prevents potential DoS issues where processing very large images could exhaust worker threads.