Skip to content

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

Open
arrangabriel wants to merge 2 commits into
elixir-grpc:masterfrom
arrangabriel:normalize-mint-errors
Open

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

Conversation

@arrangabriel

Copy link
Copy Markdown
Contributor

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.

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