Giter VIP home page Giter VIP logo

erlzk's People

Contributors

belltoy avatar glenwalker avatar kevinbombadil avatar macu1 avatar megayu avatar suexcxine avatar zolazhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

erlzk's Issues

zookeeper create2 test fail

tests on erlzk fail where it tries to use create2 - e.g.
=ERROR REPORT==== 25-Dec-2014::12:20:53 ===
Reconnect to "localhost":2181 successful
erlzk_test: erlzk_test_...failed
in function erlzk_test:delete/1 (test/erlzk_test.erl, line 140)
**error:{badmatch,{error,unimplemented}}
..where line 140 contains.
{ok, {"/a", Stat}} = erlzk:create2(Pid, "/a"),
zookeeper 3.4.6

heartbeat not fully implemented?

I ran into this problem when deliberately dropping all packets between client and one connected server - I expected to see it reconnect to one of the other servers but instead it just sat there.
If I bounce the connected server instead the fail-over is fine - but if I interrupt the connection it fails.
Looking at the code it seems like the client is not sending heartbeats to the server. Comparing it to the java I can see ping defined in ZooDefs.java but the matching operation does not appear in erlzk_codec.erl.
I'll read the java some more to understand what needs to be done to make this work - can you let me know what the position is with heartbeats from your side. --- thanks k

Not able to connect a consul zk address through vpn

Hello,

I am using the erlzk library in one of my app, which I am writing in Elixir. I am trying to connect to zk node using a consul address via vpn. It gives me error and I am not able to establish connection with the zknode. The error I am seeing is as follows:

I❤iex|2|▶▶▶ :erlzk.connect([{"pipe-apps-zookeeper-0.node.us-east-1-z.consul", 2181}], 30000)
{:ok, #PID<0.150.0>}
I❤iex|3|▶▶▶
02:21:22.525 [error] Resolving "pipe-apps-zookeeper-0.node.us-east-1-z.consul":2181 meet an error: :einval

02:21:22.525 [error] Connect fail: :no_available_server, will be try again after 1000s

02:21:23.519 [error] Connect fail: :no_available_server, will be try again after 1000s

02:21:24.520 [error] Connect fail: :no_available_server, will be try again after 1000s

##########################################################################
Also how do I send chroot while creating a zk connection. Because when I try to send it as below I am getting error:

I❤iex|3|▶▶▶ :erlzk.connect([{"pipe-apps-z-0.node.us-east-1-z.consul", 2181}], 30000, [{chroot, "/pipe-apps-general-kafka"}])
warning: variable "chroot" does not exist and is being expanded to "chroot()", please use parentheses to remove the ambiguity or change the variable name
iex:3

Bug Bug ..!!** (CompileError) iex:3: undefined function chroot/0
Bug Bug ..!! (stdlib) lists.erl:1354: :lists.mapfoldl/3

When all ZK Servers fail to resolve, erlzk becomes stuck in a loop

Thank your for your work on this project, we've enjoyed using it. We recently had this issue happen in one of our environments (thankfully not prod). The result was that our service hung and was not processing data.

Steps to reproduce

(apologies for the elixir, my erlang vocab is not so good)

  1. Set host list to be something like this:
:erlzk_conn.start_link([{'notahost.url', 2181}], ....)
  1. running (with iex -S mix) will produce this output:
14:18:28.577 [error] Resolving 'notahost.url':2181 meet an error: :nxdomain
14:18:28.577 [error] Connect fail: :no_available_server, will be try again after 1000s
14:18:29.569 [error] Connect fail: :no_available_server, will be try again after 1000s
14:18:30.570 [error] Connect fail: :no_available_server, will be try again after 1000s
....
# this continues until the program is killed

Cause

erlzk discards hosts if they fail to resolve

When we try to establish a connection to zk, this branch is always hit:

connect([], _ProtocolVersion, _LastZxidSeen, _Timeout, _LastSessionId, _LastPassword, _FailedServerList) ->

Followed by this error handler:

{error, Reason} ->

Ideas for fix

  • We could add a check for list being empty after we resolve the servers in
    ResolvedServerList = resolve_servers(ServerList),
  • track how many errors we are encountering in some time interval and die if that goes to high.
    ie. allow a max of 30 errors in 60s

I'm curious to hear your thoughts.

Tag 0.3.1

Could you please push 0.3.1 tag to repo

FORMAT ERROR after retry

Hi,

I'm seeing this:

17:16:30.770 [error] FORMAT ERROR: "Connection to ~p:~p timeout while waiting for connect reply: ~p~n" [{17 ,17,0,4},2181]

It seems to come from here.

Whats the syntax for :erlzk.multi method, if used in Elixir.

Hey I had a question: I wanted to known the synatx for :erlzk.multi method if used in elixir. I tried below but I am getting an error:

:erlzk.multi(pid, [{:create, chroot, :persistent}, {:create, "#{chroot}/job_done", :persistent}, {:create, "#{chroot}/job_pending", :persistent}, {:create, "#{chroot}/job_inprogress", :persistent}, {:create, "#{chroot}/job_failed", :persistent}])

Error levels seem too high

I'm getting a lot of error messages in my logs for normal operations while using this library. For example, these three show up a lot:

erlzk/src/erlzk_conn.erl

Lines 273 to 287 in e6495a1

terminate(normal, #state{socket=Socket}) ->
gen_tcp:send(Socket, <<1:32, -11:32>>),
gen_tcp:close(Socket),
error_logger:warning_msg("Server is closed~n"),
ok;
terminate(shutdown, #state{socket=Socket}) ->
gen_tcp:send(Socket, <<1:32, -11:32>>),
gen_tcp:close(Socket),
error_logger:warning_msg("Server is shutdown~n"),
ok;
terminate(Reason, #state{socket=Socket}) ->
gen_tcp:send(Socket, <<1:32, -11:32>>),
gen_tcp:close(Socket),
error_logger:error_msg("Server is terminated: ~p~n", [Reason]),
ok.
It would be my understanding that those would not need to be logged at all, and if they did they would be merely informative since they're normal shutdown conditions.

There are other conditions that are logged as warnings as well, such as

error_logger:warning_msg("Create a new connection to ~p:~p successful~n", [Host, Port]),
- a successful connection! Why should that trigger a warning?

Would you welcome a PR to tone these down a little?

Help wanted, kevinbombadil

Hello.
I hadn't found other way to communicate with "kevinbombadil", sorry for that way.

At one of issue for "pybind11" you sad,that you write python binding to "libdar".
Can you share that code ?
Can we discuss that in private way ?
Thank you
fred.kalsin at gmail dot com

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.