Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for Unix socket types? #5389

Closed
AgentCoop opened this issue May 31, 2022 · 6 comments
Closed

No support for Unix socket types? #5389

AgentCoop opened this issue May 31, 2022 · 6 comments

Comments

@AgentCoop
Copy link

AgentCoop commented May 31, 2022

I am a bit confused, but it looks like there is no support for socket types, the network type 'unix' is hard-coded here:

cc.UpdateState(resolver.State{Addresses: []resolver.Address{networktype.Set(addr, "unix")}})

yet we can create a server listening on unixpacket and unixgram sockets. Any connection to such a server will be refused.

@dfawley
Copy link
Member

dfawley commented May 31, 2022

Correct, these are not supported. Can you explain more about your use case? It may be possible to make them work using a custom dialer (https://pkg.go.dev/google.golang.org/grpc#WithContextDialer).

@AgentCoop
Copy link
Author

Correct, these are not supported. Can you explain more about your use case? It may be possible to make them work using a custom dialer (https://pkg.go.dev/google.golang.org/grpc#WithContextDialer).

I was just playing around with Unix sockets. I am planing to implement some services that will require to send/receive large amount of data. Taking into account the stream-oriented nature of the only supported socket type in gRPC, I had some concerns about possible issues with preserving message boundaries.

It turned out that the current implementation relies on HTTP2 transport protocol, so there should be no worries. But, in my opinion, HTTP2 is a bit of overkill in the case of Unix domain sockets. It would make sense to rely on Unix SOCK_SEQPACKET socket type for some performance gains.

I mean, we don't need multiplexing in the case of Unix domain socket: one client — one stream, and let the rest be handled by OS.

@github-actions
Copy link

github-actions bot commented Jun 7, 2022

This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the stale label Jun 7, 2022
@dfawley
Copy link
Member

dfawley commented Jun 7, 2022

What you're describing would be something that could be implemented using this proposal for custom transports: grpc/proposal#103

Unfortunately, it became deprioritized, and hasn't been worked on in some time.

@dfawley dfawley closed this as completed Jun 7, 2022
@melezhik
Copy link

By default MariaDB server starts on Unix socket , not network socket, because of this SparrowCI build for alpine fails - https://ci.sparrowhub.io/report/1461

So Unix sockets support would be good

@dfawley
Copy link
Member

dfawley commented Oct 31, 2022

Unix sockets are supported. unix:<path-to-socket> will get that to work. unixpacket and unixgram socket types are not supported, however.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants