Closed shiroyasha closed 6 years ago
Could you describe what your client and server do? This error occurs when the first header sent by the server contains a flag END_STREAM, which means the stream is end. I thought this should not happen in a normal gRPC call, so I let it return an error in this situation. But if it's reasonable for your scene, I can change that. Like below questions:
If possible, you can send me an example of your code. It'll be better if the code can reproduce the problem.
@tony612 thanks for the feedback.
This seems to happen only when I do a simple request_response call to a Ruby based GRCP server. Interestingly, when I do Elixir Client -> Elixir Server everything works, but with Elixir Client -> Ruby Server I get the above error.
I'll try to reproduce this edge case for a simple hello world GRPC call and share the code examples.
@tony612 I've prepared a hello world example communication that demonstrates this issue.
https://github.com/renderedtext/elixir-ruby-failure-example-grpc
The issue seems to be connected to timing. If the server takes more than 100ms to respond, the original error appears.
I hope this helps. Please let me know if I can help out in any other way. 🙇
Some updates:
I've added some debugging steps to the gun await method https://github.com/tony612/grpc-elixir/pull/49.
When I run the code, I got the following messages:
{:response, :fin, 200,
[{"content-type", "application/grpc"}, {"grpc-status", "4"},
{"grpc-message", "Deadline Exceeded"}]}
{:error,
%GRPC.RPCError{message: "shouldn't finish when getting headers", status: 13}}
By digging a bit deeper, I've found the following difference between the Ruby and Elixir clients:
When a Ruby client makes the call, the deadline is set to: 1970-01-01 00:59:59 +0100
.
When the Elixir client makes the call, the deadline is set to: 2018-03-22 20:49:30 +0100
(current second).
The Ruby GRPC client sets the deadline to INFINITE_FUTURE
: https://github.com/grpc/grpc/blob/7e24da469c2a931ee988d35bf99b9e47e8fa5940/src/ruby/lib/grpc/generic/client_stub.rb#L29.
Thank you. This is very helpful. I’ll fix it ASAP. On Fri, 23 Mar 2018 at 04:26 Igor Šarčević notifications@github.com wrote:
By digging a bit deeper, I've found the following difference between the Ruby and Elixir clients:
When a Ruby client makes the call, the deadline is set to: 1970-01-01 00:59:59 +0100. When the Elixir client makes the call, the deadline is set to: 2018-03-22 20:49:30 +0100 (current second).
The Ruby GRPC client sets the deadline to INFINITE_FUTURE: https://github.com/grpc/grpc/blob/7e24da469c2a931ee988d35bf99b9e47e8fa5940/src/ruby/lib/grpc/generic/client_stub.rb#L29 .
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/tony612/grpc-elixir/issues/48#issuecomment-375445963, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMhG5kooY2CJopbfF5vsMetmZboNjIPks5thAj7gaJpZM4S1OEA .
It's on master now.
I've released 0.3.0-alpha.1 to fix this.
I've tried to update to the latest release, but I am getting the following error when I try to trigger a call from from the client.
Let me know if I can help with debugging.
These are the deps on my project: