Better file handling in case of crash #12998
Gunni
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The bug
So i have been having memory problems on my host, which has causes immich to be killed by the evil OOM killer.
That should not be a problem in and of itself, but it has caused immich to leave leftover 0 byte files that don't get cleaned up, and seemingly don't get detected as empty??
My suggestion is to upload files/generate thumbs/transcode video in temp files at the location where they will eventually be stored, but either using anonymous file and then naming them, or using a temporary name like
.<name>that gets cleaned up on startup and then the slow operation can take however long it wants, and then the operation of renaming is atomic. It either happens or not.By doing this you never have broken or incomplete files.
p.s. you can put the temp files elsewhere but rename is only atomic if it does not cross mountpoints afaik.
The OS that Immich Server is running on
FreeNAS Scale
Version of Immich Server
v1.115.0
Version of Immich Mobile App
v1.115.0
Platform with the issue
Your docker-compose.yml content
N/AYour .env content
Reproduction steps
Relevant log output
No response
Additional information
No response
All reactions