mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5392] [MERGED] fix: recover stale storage locks after Docker container replacement #6747
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6747
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/Pasta-Devs/Marinara-Engine/pull/5392
Author: @NeoKazuya
Created: 8/22/2026
Status: ✅ Merged
Merged: 8/22/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/docker-stale-lock-recovery📝 Commits (6)
a99c7c1fix: recover stale storage locks after Docker container replacementb825104fix: make writer lease socket cleanup idempotent7b46ebatest: fail when the stale socket helper exits early6ec21d5test: require container writer liveness coverage698ccb4fix: preserve writer lease acquisition error contract5d7aeefMerge branch 'staging' into fix/docker-stale-lock-recovery📊 Changes
3 files changed (+277 additions, -34 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/db/file-backed-store.ts(+175 -29)📝
scripts/regressions/storage-writer-lock.regression.ts(+101 -5)📄 Description
Linked issue
Closes #5389
Why this change
If a container exits before shutdown cleanup finishes, it can leave Marinara's storage lock (
.writer-lease) in the mounted data folder. Outside containers, the machine identity normally stays the same between starts, so Marinara can check whether the recorded process is still running. A replacement container has a new hostname and may reuse the same internal PID, so the current checks cannot confirm that the old container is gone and block the replacement on every startup.What changed
This adds one local socket while Marinara is running, with no polling or storage scan.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm checkpassed.pnpm testpassed all 143 regressions.stagingat57e29c8b6still fails after a force-killed container is replaced on the same volume: the replacement had a different hostname, reused PID 13, exited with code 1, and left the old lock unchanged./api/health. A second live container using that volume was rejected withStorageWriterLeaseErrorwhile the replacement stayed healthy. Clean shutdown removed the lock.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG.mdis updated. The existing troubleshooting steps remain valid for older locks and cases where Marinara cannot confirm that the previous process stopped.UI evidence (if applicable)
Summary by CodeRabbit
Bug Fixes
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.