fix(guardian): reclaim stale Docker locks after container replace - #1177
Draft
RainMona wants to merge 1 commit into
Draft
fix(guardian): reclaim stale Docker locks after container replace#1177RainMona wants to merge 1 commit into
RainMona wants to merge 1 commit into
Conversation
Docker recreate changes /etc/machine-id, so leftover guardian/runtime locks look foreign. The previous owner is gone, but startup treated the home as still owned by another machine and exited. Compose restart: unless-stopped then crash-looped. Persist a volume-stable machine id for Docker, quarantine stale foreign locks without signaling, and let --takeover reclaim a foreign lock the same way. Desktop/CLI still refuse automatic cross-machine reclaim. Co-authored-by: RainMona <RainMona@users.noreply.github.com>
|
@cursoragent is attempting to deploy a commit to the luokerenx4's Team Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docker 换容器后残留
guardian.lock/runtime.lock被当成“另一台机器还在跑”,Composerestart: unless-stopped会死循环。这笔修复基于当前
TraderAlice/dev,从 forkRainMona/OpenAlice提过来,便于主仓库审计。未合并。现象
容器重建后
/etc/machine-id变了,卷里留下的 lock 仍写着旧 hostname / PID / heartbeat。Guardian 先做 machineId 比对,对不上就判active,过期心跳也不回收;--takeover以前还会拒绝(不能对外机 PID 发信号)。进程非零退出,Compose 一直重启。现场三把锁:
$OPENALICE_HOME/state/guardian.lock$OPENALICE_HOME/state/runtime.lock$AQ_LAUNCHER_ROOT/state/runtime.lock把它们挪走就能恢复。根因是锁策略,不是 compose。
设计
桌面 / CLI 仍拒绝“心跳过期就自动抢外机卷”,也仍然不对外机 PID 发信号。Docker 按单写者合同:
/data/state/machine-id,之后重建容器还是同一身份。--takeover/OPENALICE_TAKEOVER=1对外机 lock 也改为隔离、不发信号。请按
review:deep审计。Verification
pnpm -F @traderalice/guardian-runtime teston current upstreamdev+ this commit (59 passed, including the existingterminateProcessTreespec)