fix(nodes): skip checksum sidecars when staging option dirs

stageDirectory and countStageableFiles already skip them, but
stageOptionDir did not - and it is the path sherpa-onnx voices take for
espeak-ng-data. The receiver writes "<file>.sha256" for every file it
accepts, so staging the sidecars made it write sidecars for those in
turn, one level deeper on every load.

Observed on a live node: "<file>.sha256" repeated eleven times, 5077
junk files out of 7832 in the models dir, and still growing. Staging
never finished, so vits-piper-it_IT-paola-sherpa stayed permanently
"staging on node" and every realtime warmup needing that voice failed
with the session then going silent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0142UfUh8HWxdim5JZqf8Tr6
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di GiacintoandClaude Opus 5 committed 2026-09-01 00:03:04 +02:00
1 parent 357eabf382
commit 5555a3c569
1 file changed
+10
+10
View File
@@ -1874,6 +1874,16 @@ func (r *SmartRouter) stageOptionDir(ctx context.Context, node *BackendNode, dir
if walkErr != nil || d.IsDir() {
return nil
}
// Same reason as stageDirectory: the receiver writes "<file>.sha256" for
// every file it accepts, so staging the sidecars makes it write sidecars
// for those in turn. Option dirs are walked on every load, so each pass
// added a level - an espeak-ng-data tree observed in the wild had grown
// to "<file>.sha256" repeated eleven times and 5077 junk files, which is
// enough to keep a sherpa-onnx voice permanently "staging" and fail
// every realtime warmup that needs it.
if isHashSidecar(path) {
return nil
}
if _, err := r.fileStager.EnsureRemote(ctx, node.ID, path, keyFn(path)); err != nil {
xlog.Warn("Failed to stage option directory file, skipping", "path", path, "error", err)
}