Skip to content

CSI: never replace a live socket; remove only our own socket on exit (#61) - #63

Merged
gspark-etri merged 1 commit into
mainfrom
fix/csi-socket
Oct 22, 2026
Merged

gspark-etri merged 1 commit into
mainfrom
fix/csi-socket

Conversation

@gspark-etri

Copy link
Copy Markdown
Contributor

Background

In the #54/#55 cluster run, a plugin pod that stayed Terminating for 28 minutes started late and exited at once. On exit it removed the live plugin's csi.sock, and every mount failed until the plugin restarted (#61). Two things removed the socket: onggi csi removed the path on shutdown, and Go's UnixListener also unlinks its path on Close by default.

Changes

  • csi.Listen:
    • If a socket at the endpoint answers, it refuses to start ("another plugin is listening there"). A stale, dead socket file is still replaced.
    • The listener no longer unlinks on close. Close removes the path only if it is still the socket this process created (same file), once.
  • cmd/onggi/csi.go closes the listener instead of removing the path.

Verification

  • New test TestListenKeepsTheLiveSocket:
    • a second Listen on a live socket fails;
    • after the old plugin's file is gone and a new plugin listens, the old plugin's late Close leaves the new socket in place;
    • the new plugin's Close removes its own socket.
  • TestServeOverUnixSocket and the full suite pass on the node; gofmt and vet are clean.

Compatibility and limits

  • A second plugin on the same data and socket directory now exits instead of taking over. That matches the existing rule of one plugin per node and data directory.

Related Issue

Closes #61

🤖 Generated with Claude Code

…61)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gspark-etri
gspark-etri merged commit 2a04e96 into main Oct 22, 2026
3 checks passed
@gspark-etri
gspark-etri deleted the fix/csi-socket branch October 22, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSI: an exiting plugin removes the live plugin's socket

1 participant