perf(ssh): reuse one connection per Spark instead of a login per poll (rebased) - #84
Merged
MikeGibbsOnyx merged 1 commit intoSep 8, 2026
Conversation
MikeGibbsOnyx
force-pushed
the
tode/ssh-connection-reuse
branch
from
September 8, 2026 20:45
5443ac9 to
63dfe8a
Compare
MikeGibbsOnyx
pushed a commit
that referenced
this pull request
Sep 8, 2026
#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.
Rebased #83 onto 6ab932e+merged 81/82/79. Conflict in SparkMonitor.js resolved keeping both the single-trip liveness optimization and the run-generation commit guard; ssh.js multiplex merged with the credential-isolated control socket (312/312 server tests green). Supersedes #83 (original author Liao Shiwu preserved via cherry-pick); #77 solves the same problem differently.