eigr / massa

A Stateful Serverless framework on the BEAM VM
https://eigr.io
Apache License 2.0
54 stars 5 forks source link

Gun errors with Stream #118

Open sleipnir opened 2 years ago

sleipnir commented 2 years ago

Describe the bug

While I was working to add support for Forwards and Side Effects I ended up noticing that the gRPC client of the Elixir library that uses the Gun library had some errors when I tried to return a Stream mapped with the results of the requests to the user role as a return in calling a GenServer.

Error:

gun-error

I was only able to solve the problem when I materialized the stream through an Enum.to_list() and returned a list instead of the Stream:

gun-success

While this works for the moment and I keep this workaround for now I believe this approach is not the best approach to what we need to do. The Elixir gRPC library is pretty bad to work with stream, its API is quite confusing and passive of errors in its use and from time to time I end up encountering these kinds of strange errors. It is essential that we manage to work well with un-bounded streams (infinite streams) and we need to quickly find an alternative to this library. We recently forked this library and renamed it Falco, we need to speed up work on this version to resolve these issues