-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Hey,
I am running
- Dgraph v1.0.5
- on MacOS 10.13.5, 16GB RAM
- with the default docker-compose file
The connection of the Elixir client that I am developing at the moment (ExDgraph) kept breaking every ~ 20 seconds. Investigating this issue I found that modifying the http2 connect options of gun (the http2 client the grpc client is using for the connection) would get rid of this issue. More specifically setting the keepalive value to infinity and thereby disabling the ping that gun sends to Dgraph to keep the connection alive. The default value was 5,000 ms which caused a connection break every 20,000ms. Decreasing the keepalive value also decreased the time between connection crashes in the same ratio so this is a strong correlation for me.
The downside of this "fix" is that this disables pings entirely and so I might not know when a server is gone until the write buffers are full.
I suspect that this is a bug either in Dgraph and how it handles the ping message or in gun. I also opened an issue over in the gun repo.
The gun docs state about the ping:
Time between pings in milliseconds. Since the HTTP protocol has no standardized way to ping the server, Gun will simply send an empty line when the connection is idle. Gun only makes a best effort here as servers usually have configurable limits to drop idle connections. Use infinity to disable.
Any help with fixing this issue is greatly appreciated. If you need more information let me know.
Thanks