mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
[PR #13411] [MERGED] Use WriteThrough for ImageSaver #13388
Labels
No labels
area:database
awaiting-feedback
backend
blocked
breaking change: web api
bug
build
ci
confirmed
discussion needed
dotnet future
downstream
duplicate
EFjellyfin.db
enhancement
feature
future
github-actions
good first issue
hdr
help wanted
invalid
investigation
librarydb
live-tv
lyrics
media playback
music
needs testing
nuget
performance
platform
pull-request
question
regression
release critical
requires-web
roadmap
security
security
stale
support
syncplay
ui & ux
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/jellyfin#13388
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/13411
Author: @gnattu
Created: 1/23/2025
Status: ✅ Merged
Merged: 1/25/2025
Merged by: @joshuaboniface
Base:
release-10.10.z← Head:use-writethrough-imagesaver📝 Commits (1)
644df35Use WriteThrough for ImageSaver📊 Changes
1 file changed (+1 additions, -0 deletions)
View changed files
📝
MediaBrowser.Providers/Manager/ImageSaver.cs(+1 -0)📄 Description
When writing an image to the disk, we use the completion of the async task as a signal indicating the completion of a write operation. However, this approach may not be entirely accurate, as the operating system can optimize IO operations by writing data to an intermediate cache instead of directly to the disk before completing the operation. This optimization can lead to a data race for our scanner, as subsequent tasks such as blurhash computation may attempt to read a file that has not yet been flushed from the volatile cache. Consequently, the data within the file becomes invalid, causing the blurhash computation task to fail.
Use WriteThrough mode to ensure the data is actual on disk before return to resolve this issue.
Changes
Issues
Fixes #3687
If https://github.com/Bond-009/BlurHashSharp/pull/87 is merged and BlurHashSharp get updated, as there is another race condition when multiple threads attempting to open the same image file, but the native open method in skia prevents readonly shares.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.