Skip to content

fix(mint): fail with UNAVAILABLE when the connection drops - #581

Open
arrangabriel wants to merge 1 commit into
elixir-grpc:masterfrom
arrangabriel:normalize-mint-errors
Open

fix(mint): fail with UNAVAILABLE when the connection drops#581
arrangabriel wants to merge 1 commit into
elixir-grpc:masterfrom
arrangabriel:normalize-mint-errors

Conversation

@arrangabriel

Copy link
Copy Markdown

Fail with UNAVAILABLE when the Mint connection drops

A connection that was established and then went away failed with gRPC error status UNKNOWN.
gRPC reserves UNAVAILABLE for a transient transport failure.
A request that was already in flight when the connection dropped returned a {:error, "the connection is closed"} string rather than a %GRPC.RPCError{}.

Changes

  • Connection-closed errors are now built as %GRPC.RPCError{status: unavailable} in the connection process, so every path out of a dropped connection carries the struct.
  • handle_errors_receive_data/2's error wrapping now goes through (rpc_error/1).
    • An error that already carries a status passes through untouched.
    • Mint transport errors and connection-gone HTTP/2 reasons map to UNAVAILABLE. Reasons that cannot be classified still fail with UNKNOWN.

@arrangabriel
arrangabriel force-pushed the normalize-mint-errors branch from 8a36fb1 to 87896cc Compare August 28, 2026 06:01
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.

1 participant