A crash-killed clone wedges the module work tree permanently #28
Loading…
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?
Follow-up from the review of #27 (approved; not a blocker there).
syncRepo(packages/server/src/modules/external.ts:186-199) picks clone-vs-fetch from the presence of<srcDir>/.git, never from its validity:Measured behaviour on an interrupted clone:
srcDirAbortControlleringit()sends. .. .gitSo the 120 s self-kill added in #27 is clean. SIGKILL is the other case: an OOM kill,
docker stoppast the grace period, a host reset mid-clone. With a partial.giton disk, every git command insyncRepoanswersThat matches no fragment in
TRANSIENT_GIT_ERRORS, soisRetryableFailureis false, the retry loop never takes the repo, and the module stays disabled on that boot and every boot after it — with no action named in the notification that would clear it. Manualrm -rf /data/modules/src/<slug>is the only recovery, and nothing tells the operator that.The wedge predates #27. It is worth closing anyway because #27 is what makes "the container heals itself" the contract, and this is the single clone-stage failure it can never heal.
Suggested fix
git -C <dir> rev-parse --git-dirinstead ofstat(.git).srcDirand fall through to a fresh clone.<srcDir>/.gitas a directory containing nothing (or a regular file), assertprepareExternalModulestill ends up at the right commit.