-
-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection keeps breaking with gun_down #158
Comments
Try setting a lower keepalive value. |
Hey @essen, thank you for the suggestion. I tried lowering the Now I set keepalive to Thanks |
Sounds like there's a bug either in Gun's ping message or in the server. The downside is that this disables pings entirely and so you might not know when a server is gone until the write buffers are full. |
What's the server? |
True that @essen. I will contact the devs from Dgraph and report back if they can identify a bug so that we can narrow it down. |
Server is Dgraph / https://github.com/dgraph-io/dgraph . |
My guess is that this is rather a bug in gun then. The reason for my suspicion is that Dgraph has clients in Go, Java, Javascript, Python, etc. and they don't seem to have this issue. |
Feel free to double check the code:
Would be good to have server logs for why the connection was dropped, or to trace the modules gun and gun_http2 to get that same reason. |
The server doesn't write anything to the logs when the connection ends. How would I go about tracing gun and gun_http2 in an Elixir application? |
In Erlang:
|
Thanks. Elixir was very similar since you can call Erlang modules with
The raw output of the trace. I in between are the gun_down messages from my client: https://gist.github.com/ospaarmann/c592fa984f775810b2698bf0b4d82228 |
Server is dropping the connection with I suppose 5 seconds is too much? Not sure why, but I guess setting a larger value would fix your issue. Cheers. |
Thank you for the fast support! I will try that. |
@ospaarmann did you ever fix this without setting |
For what it's worth the default in 2.0 will be |
@essen Yeah, I've been trying to find out more info all day and finally getting into some stuff that makes sense. As you probably expected, it seems it's likely just a mismatch in the Example from grpc core there is lots of good info: https://grpc.github.io/grpc/cpp/md_doc_keepalive.html I think it probably has to do with:
And from the FAQ, the last bullet point in the last question:
Defaults
|
And if servers are going to have these kinds of defaults it's not worth doing pings without prior knowledge that they're going to work. |
Hey,
I use the Elixir gRPC implementation https://github.com/tony612/grpc-elixir to build a Dgraph client written in Elixir (https://github.com/ospaarmann/exdgraph). grpc-elixir in turn uses gun (
1.0.0-pre.5
).My connection keeps breaking every X seconds with
gun_down
and reason normal.I don't see anything in the server Dgraph server logs. The connection isn't using ssl. Interestingly it happens very regularly every 5 or so seconds so.
I am a bit lost on how to debug this and I have little experience with Erlang, only Elixir so far. My apologies that I cannot provide more information right now but I can deliver whatever helps.
Any hint or help is greatly appreciated!
❤️
The text was updated successfully, but these errors were encountered: