Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock on convert #307

Merged
merged 4 commits into from
Dec 29, 2023
Merged

Lock on convert #307

merged 4 commits into from
Dec 29, 2023

Conversation

n0vad3v
Copy link
Member

@n0vad3v n0vad3v commented Dec 29, 2023

In some cases when multiple concurrent requests are made to WebP Server, for example to a image with size of 10MiB, when the conversion is on-going, WebP Server will spawn multiple threads per request to convert the same image, which is not good and can exhaust all server resources in some condition.

This PR added a Lock called ConvertLock to prevent this from happening, thus there will be only one thread for converting a specific image at any given moment.

Copy link


ghcr.io/webp-sh/webp_server_go (debian 12.4)
============================================
Total: 0 (HIGH: 0, CRITICAL: 0)


@n0vad3v
Copy link
Member Author

n0vad3v commented Dec 29, 2023

This can also be the potential cause described in #213.

@n0vad3v n0vad3v merged commit d35e0e0 into master Dec 29, 2023
6 checks passed
@n0vad3v n0vad3v deleted the lock-on-convert branch December 29, 2023 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants