mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-06 04:23:15 -05:00
With PostgreSQL and a filesystem blob store, Put and CommitUpper took the global revision row lock before reading the upload. A slow or large upload then blocked every other write and purge and kept a pool connection for its whole duration. Split the filesystem blob Put into Stage (read, hash, fsync a temp file) and Publish (rename). The workspace stages first, takes the lock, then publishes, so a purge still cannot remove a blob between publication and the row that references it. Publish syncs only the folder that gains the name; newly created folders are already synced by mkdir. Assisted-by: Claude Code:claude-sonnet-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>