feat: add unix domain socket listener support to port option#1932
Open
benmcclelland wants to merge 1 commit intomainfrom
Open
feat: add unix domain socket listener support to port option#1932benmcclelland wants to merge 1 commit intomainfrom
benmcclelland wants to merge 1 commit intomainfrom
Conversation
niksis02
reviewed
Mar 5, 2026
| &cli.StringSliceFlag{ | ||
| Name: "port", | ||
| Usage: "gateway listen address <ip>:<port> or :<port> (can be specified multiple times for listening on multiple addresses)", | ||
| Usage: "gateway listen address: <ip>:<port>, :<port>, /path/to/socket for file-backed UNIX sockets, or @name for Linux abstract namespace sockets (can be specified multiple times for listening on multiple addresses)", |
Contributor
There was a problem hiding this comment.
Update example.conf to add info about unix sockets ?
crabique
reviewed
Mar 5, 2026
s3api/utils/multi_listener.go
Outdated
| // For file-backed sockets, remove any stale file so re-binding works cleanly. | ||
| // Abstract sockets (@name) have no filesystem entry; skip os.Remove for them. | ||
| if !isAbstractSocket(address) { | ||
| os.Remove(address) |
There was a problem hiding this comment.
Probably also need to verify that it's fs.ModeSocket that's being removed, someone might accidentally use it as an rm 😄
crabique
reviewed
Mar 5, 2026
| // - "@name" — Linux abstract namespace socket (no filesystem entry) | ||
| func IsUnixSocketPath(addr string) bool { | ||
| return strings.HasPrefix(addr, "/") || | ||
| strings.HasPrefix(addr, "./") || |
There was a problem hiding this comment.
the relative path seems to be a problematic use-case: with posix backend the CWD is set to the data directory before the listener is initialized, so the socket is being created there instead of the CWD of the shell invoking the gateway startup
This adds the ability to specify unix domain socket paths for the service listener with the --port <path> option. Where <path> can be either a path to a file in a filesystem or prefixed with @ for an abstract socket name.
96c39ce to
388ace5
Compare
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.
This adds the ability to specify unix domain socket paths for the service listener with the --port option. Where can be either a path to a file in a filesystem or prefixed with @ for an abstract socket name.