Comments (6)
I think we should change resolve_server to return {ok, Result} or {error, Reason} rather than always a bare list. It should return {ok ,[]} only for {error, nxdomain} and return any others errors unchanged.
resolve_servers will need to be updated to handle the new {ok, Result} or {error, Reason} return from resolve_server, and also to return {ok, Result} or {error, Reason} instead of a bare list. It should return any errors from resolve_server immediately.
init will need to be updated to handle the new {ok, Result} or {error, Reason} return from resolve_servers and if {ok, []} or {error, Reason} are returned, it should return {stop, Reason} rather than continuing on to deduplicate and shuffle the list, and attempt to connect.
I think this behaviour is consistent with the Java implementation, and should fix the issue. I'll try to find time to make a pull request for this.
from erlzk.
Thank you for the detailed report.
Your ideas for fixing sounds good for me, and pull request is very welcomed.
from erlzk.
It might be worth tracking what type of error is returned by inet:gethostbyname (transient errors like timeouts, or permanent errors like nxdomain). If all calls to inet:gethostbyname return permanent errors then give up, but if all calls return transient errors then keep retrying, and if any calls succeed in resolving a name then continue.
When I made the changes related to DNS resolution, retrying etc in #9 I tried to make the behaviour of erlzk similar to the Java library for ZooKeeper, so it might be worth reading through that to see if it gives any hints. If I have any time I'll take a look.
from erlzk.
@GlenWalker That would be very nice, and thank you for your previous improvements to erlzk
again.
from erlzk.
Thanks! We should probably also tag this as v0.6.4 too, since I updated package.exs and erlzk.app.src to 0.6.4
from erlzk.
@GlenWalker Yes, done. Really appreciated for your contribution.
from erlzk.
Related Issues (10)
- zookeeper create2 test fail HOT 3
- Not able to connect a consul zk address through vpn HOT 2
- Whats the syntax for :erlzk.multi method, if used in Elixir. HOT 1
- Help wanted, kevinbombadil
- FORMAT ERROR after retry HOT 1
- Tag 0.3.1 HOT 1
- Error levels seem too high HOT 5
- erlang:now is deprecated in Erlang 18 HOT 1
- heartbeat not fully implemented? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from erlzk.