elixir-grpc / grpc

An Elixir implementation of gRPC
https://hex.pm/packages/grpc
Apache License 2.0
1.39k stars 212 forks source link

server_stream keeps disconnecting #312

Open nulian opened 1 year ago

nulian commented 1 year ago

Found that connecting with a server with a server stream it keeps disconnecting.

We where trying to connect with the Watch request in spicedb but usually we get auto disconnected.

Also tried the mint adapter it has the same issue but found it on server_stream the open check in connection_process.ex is checked as Mint.HTTP.open?(state.conn, :read) it works correctly. This is because the connection is half closed by the server read only no writes allowed.

Not sure how to fix it in the gun adapter.

polvalente commented 1 year ago

Do you have a reproduction for this? Either direct code or more specific conditions in which this problem happens.

polvalente commented 1 year ago

Also, if there's already a known fix for the Mint client, PR is welcome!

nulian commented 7 months ago

The issue came forward when we had response streaming only

rpc :Watch,
      AuthorizationGrpc.Authorization.WatchRequest,
      stream(AuthorizationGrpc.Authorization.WatchResponse)