Skip to content

fix: linkspan socket in sticky /tmp, not a shared csbridge/ dir#105

Merged
yasithdev merged 1 commit into
mainfrom
linkspan-socket-path
Jul 18, 2026
Merged

fix: linkspan socket in sticky /tmp, not a shared csbridge/ dir#105
yasithdev merged 1 commit into
mainfrom
linkspan-socket-path

Conversation

@yasithdev

Copy link
Copy Markdown
Contributor

Summary

linkspan's unix socket lived at /tmp/csbridge/<id>.sock, and the SLURM job script ran mkdir -p /tmp/csbridge. On a shared compute node, the first user to launch a session there ends up owning /tmp/csbridge at mode 0755. Every subsequent different user's mkdir -p is a silent no-op (the dir already exists), and linkspan's bind() on the socket fails:

failed to listen on unix socket /tmp/csbridge/<id>.sock: bind: permission denied

Observed live on the Nexus cluster: /tmp/csbridge on node c2 was drwxr-xr-x 2000043 2000043, so nexus-yjayawardana (uid 2000047, only in the group — no group write) couldn't create his socket and every session on that node failed with exit 1:0.

Fix

Bind the socket at /tmp/csbridge-<id>.sock — directly in the sticky, world-writable /tmp — instead of inside a shared csbridge/ subdirectory. Each user creates and owns their own socket; the sticky bit stops others deleting it; there is no shared directory to clash over. The mkdir -p line is gone (nothing to create). The socket name already carries the unique session id, so slurmSupport's srun --overlap curl --unix-socket … channel follows automatically, and linkspan needs no change (it binds whatever --socket it's handed and clears its own stale path via os.Remove).

Test plan

  • npm run check-types — clean
  • npm test — 108/108 pass (updated the buildSlurmScript assertion to the new path)
  • npm run package — builds
  • Generated script verified: --socket /tmp/csbridge-<id>.sock, no mkdir, no /tmp/csbridge/ dir reference

🤖 Generated with Claude Code

The socket lived at /tmp/csbridge/<id>.sock and the SLURM job script ran
`mkdir -p /tmp/csbridge`. On a shared compute node the first user to launch
a session owns /tmp/csbridge (mode 0755); every later user's `mkdir -p` is a
no-op and linkspan's bind() on its socket fails with EACCES
("bind: permission denied").

Bind the socket at /tmp/csbridge-<id>.sock directly in the sticky,
world-writable /tmp so each user creates and owns their own socket with no
shared directory to clash over. The socket name already carries the unique
session id; linkspan needs no change (it binds whatever --socket it is given
and clears its own stale path).
@yasithdev
yasithdev marked this pull request as ready for review July 18, 2026 18:29
@yasithdev
yasithdev merged commit 2bd4a18 into main Jul 18, 2026
2 checks passed
@yasithdev yasithdev mentioned this pull request Jul 18, 2026
yasithdev added a commit that referenced this pull request Jul 18, 2026
Bump to 0.1.0 and record the linkspan shared-socket-dir permission fix (#105).
@yasithdev
yasithdev deleted the linkspan-socket-path branch July 18, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant