fix(ssh): expand ControlPath %C ourselves — socket must fit sun_path - #85
Merged
MikeGibbsOnyx merged 1 commit intoSep 8, 2026
Merged
Conversation
MiaAI-Lab#84 shipped ControlPath=os.tmpdir()+"sparkdash-%C" through execFile. Two assumptions were wrong: execFile performs no %-expansion (ssh only expands %C for shell-parsed configs, not execFile argv), and the socket is created LOCALLY — on macOS $TMPDIR is a ~60-char per-user path, so the literal landed at ~120 chars, past the ~104-byte sun_path limit. Every remote collector died with 'unix_listener: path ... too long' and remote Sparks rendered offline with a log spam per poll tick. Fix: compute the same hash OpenSSH uses for %C (sha1 of localHost:user:remoteHost:port) and hang the socket at /tmp/sparkdash-<hex> — 60 chars, every platform. Test now asserts the expanded literal's length and absence of '%' so the template can never regress. Verified on macOS against a live Spark: before = all collectors erroring, spark offline; after = online, uptime/GPU/network collected, zero errors, control socket present at /tmp/sparkdash-9db2... Suite 314/314, frontend 23/23, tsc 0, build green.
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.
Follow-up to #84. Reproduced and fixed on macOS against a live Spark.
Bug: #84 passed
ControlPath=$TMPDIR/sparkdash-%Cthrough execFile. execFile does no %-expansion, and the socket is created locally — macOS $TMPDIR is a ~60-char per-user dir, so the literal is ~120 chars, past the ~104-byte sun_path limit. Result:unix_listener: path ... too longon EVERY remote collector; remote Sparks render offline with a log-spam per poll tick. Unit tests missed it because they asserted the template string, not the expanded literal.Fix: compute OpenSSH's own %C formula (sha1 of localHost:user:remoteHost:port) and put the socket at /tmp/sparkdash- = 60 chars on every platform.
Receipts (fresh clone of 950ac31/ef5b314, run on Mac against nyx-den):