Skip to content

fix: grpc_server crash on unix sockets - #666

Merged
polvalente merged 2 commits into
elixir-grpc:masterfrom
markovejnovic:fix/665-uds-crash
Nov 22, 2026
Merged

polvalente merged 2 commits into
elixir-grpc:masterfrom
markovejnovic:fix/665-uds-crash

Conversation

@markovejnovic

@markovejnovic markovejnovic commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #665. Note this is vibe-coded (I removed some slop and confirmed it fits existing patterns), but looks correct to me.

Validation

cd grpc_server
git switch --detach debb38c # the commit that added the test
mix test test/grpc/server/adapters/cowboy_unix_socket_test.exs
# fails
git switch fix/665-uds-crash
mix test test/grpc/server/adapters/cowboy_unix_socket_test.exs
# passes

Unrelated

Funny PR number

Regression for elixir-grpc#665. GRPC.Server.Supervisor with
adapter_opts: [ip: {:local, path}] fails to start the listener with a
Protocol.UndefinedError raised from running_info/4. Red on this commit;
the next one fixes it.
… log

:ranch.get_addr/1 returns {:local, path} for a unix socket listener.
running_info/4 read it as {ip, port}, passed :local to :inet.ntoa/1 and
interpolated the {:error, :einval} it got back, which raised inside
Cowboy.start_link/5 and stopped the listener from starting.
GRPC.Server.start/3 does not log this line and was not affected.

A unix socket listener now logs "Running ... with Cowboy using http on
unix:<path>". The IP log line is unchanged.
@polvalente
polvalente merged commit 8a14dc9 into elixir-grpc:master Nov 22, 2026
5 checks passed
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.

bug(1.1.0): grpc_server crashes on unix sockets

2 participants