Giter VIP home page Giter VIP logo

zookeeper's Introduction

zookeeper

Build Status

An interface to the Zookeeper cluster coordination server.

For a higher-level interface with a more convenient API and features such as locks, have a look at ZK.

Fork Safety!

As of 1.1.0, this library is fork-safe (which was not easy to accomplish). This means you can use it without worry in unicorn, resque, and whatever other fork-philic frameworks you sick little monkeys are using this week. The only rule is that after a fork(), you need to call #reopen on the client ASAP, because if you try to peform any other action, an exception will be raised. Other than that, there is no special action that is needed in the parent.

License

Copyright 2008 Phillip Pearson, and 2010 Twitter, Inc. Licensed under the MIT License. See the included LICENSE file.

Portions copyright 2008-2010 the Apache Software Foundation, licensed under the Apache 2 license, and used with permission.

Portions contributed to the open source community by HPDC, L.P.

Install

sudo gem install zookeeper

Usage

Connect to a server:

require 'rubygems'
require 'zookeeper'
z = Zookeeper.new("localhost:2181")
z.get_children(:path => "/")

Idioms

The following methods are initially supported:

  • get
  • set
  • get_children
  • stat
  • create
  • delete
  • get_acl
  • set_acl

All support async callbacks. get, get_children and stat support both watchers and callbacks.

Calls take a dictionary of parameters. With the exception of set_acl, the only required parameter is :path. Each call returns a dictionary with at minimum two keys :req_id and :rc.

A Bit about this repository

Twitter's open source office was kind enough to transfer this repository to facilitate development and administration of this repository. The zookeeper gem's last three releases were recorded in branches v0.4.2, v0.4.3 and v0.4.4. Releases of the slyphon-zookeeper gem were cut off of the fork, and unfortunately (due to an oversight on my part) were tagged with unrelated versions. Those were tagged with names release/0.9.2.

The plan is to keep the slyphon-zookeeper tags, and to tag the zookeeper releases twitter/release/0.4.x.

Further work will be carried out on this repository. The 0.9.3 release of the zookeeper gem will be released under the 'zookeeper' name, and will bring the two divergent (conceptual) branches of development together.

zookeeper's People

Contributors

alexsc avatar berlincount avatar casperisfine avatar cdonati avatar dantswain avatar dynamix avatar eric avatar fbernier avatar gogreen53 avatar jaeho-kim avatar jc00ke avatar jmhodges avatar lexspoon avatar malmckay avatar mheffner avatar mrgordon avatar neilconway avatar nickmarden avatar pftg avatar reidmorrison avatar slyphon avatar stass avatar wickman 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

zookeeper's Issues

Upgrade gem on rubygems

Current zookeeper 0.4.4 rubygems does not compile under debian > squeeze.

Github one does works altought its pretty hard to install it, didn't foud any gemspec file.

I wonder if I'm in the right place to ask this but please upgrade zookeeper gem on rubygems thank you.

Failure to compile on Windows Server 2008 with Cygwin

Hi! Firstly, thanks for the gem, it work's great on linux. Unfortunately we also need it to work in Windows but we are running into some problems. We are using Cygwin on Windows Server 2008 with the following packages installed:

make/gcc/git/tar/libcrypt/patch/automake/gcc-g++/ruby1.9.3

When we just do a system gem install the following happens:

$ gem install zookeeper
Fetching: zookeeper-1.4.6.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing zookeeper:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby.exe extconf.rb

Building zkc.
tar xzf zkc-3.4.5.tar.gz 2>&1
patch -p0 < patches/zkc-3.4.5-logging.patch 2>&1
patching file zkc-3.4.5/c/src/zookeeper.c
./configure --prefix=/usr/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.6/ext --with-pic --without-cppunit --disable-dependency-tracking 2>&1
checking for doxygen... no
checking for perl... /usr/bin/perl
checking for dot... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for generated/zookeeper.jute.c... yes
checking for generated/zookeeper.jute.h... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking build system type... ./config.guess: unable to guess system type

This script, last modified 2005-07-08, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub

If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to [email protected] in order to provide the needed
information to handle your system.

config.guess timestamp = 2005-07-08

uname -m = x86_64
uname -r = 1.7.25(0.270/5/3)
uname -s = CYGWIN_NT-6.0
uname -v = 2013-08-31 20:37

/usr/bin/uname -p = unknown
/bin/uname -X =

hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = x86_64
/usr/bin/oslevel =
/usr/convex/getsysinfo =

UNAME_MACHINE = x86_64
UNAME_RELEASE = 1.7.25(0.270/5/3)
UNAME_SYSTEM = CYGWIN_NT-6.0
UNAME_VERSION = 2013-08-31 20:37
configure: error: cannot guess build type; you must specify one
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
extconf.rb:51:in safe_sh': command failed! ./configure --prefix=/usr/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.6/ext --with-pic --without-cppunit --disable-dependency-tracking 2>&1 (RuntimeError) from extconf.rb:75:inblock (2 levels) in

'
from extconf.rb:71:in chdir' from extconf.rb:71:inblock in '
from extconf.rb:55:in chdir' from extconf.rb:55:in'

Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.6 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.6/ext/gem_make.out


Unfortunately the mkmf.log is also missing. My colleagues and I narrowed this specific problem down to the config.guess that is inside of the zkc.tar.gz is out of date (from 2005). The way to manually modify this was to edit the config.guess to have the following entry (instead of x86_64-unknown-cygwin):

amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
    echo x86_64-pc-cygwin

Once we figured this out (as well as figured out what specific dependencies and libraries we needed to install on cygwin) we eventually hit a brick wall with the actual make command. More specifically (and sorry for long stack trace):

$ make
make all-am
make[1]: Entering directory /vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c' /bin/sh ./libtool --tag=CC --mode=link gcc -Wall -Werror -g -O2 -D_GNU_SOURCE -o cli_mt.exe cli_mt-cli.o libzookeeper_mt.la gcc -Wall -Werror -g -O2 -D_GNU_SOURCE -o cli_mt.exe cli_mt-cli.o ./.libs/libzookeeper_mt.a -lpthread cli_mt-cli.o: In functionstate2String':
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:73: undefined reference to __imp_ZOO_CONNECTING_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:73:(.text+0x98): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_CONNECTING_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:75: undefined reference to __imp_ZOO_ASSOCIATING_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:75:(.text+0xab): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_ASSOCIATING_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:77: undefined reference to __imp_ZOO_CONNECTED_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:77:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_CONNECTED_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:79: undefined reference to __imp_ZOO_EXPIRED_SESSION_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:79:(.text+0xd1): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_EXPIRED_SESSION_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:82: undefined reference to __imp_ZOO_AUTH_FAILED_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:82:(.text+0xe4): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_AUTH_FAILED_STATE'
cli_mt-cli.o: In function type2String': /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:88: undefined reference to__imp_ZOO_CREATED_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:88:(.text+0x100): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_CREATED_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:90: undefined reference to__imp_ZOO_DELETED_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:90:(.text+0x10f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_DELETED_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:92: undefined reference to__imp_ZOO_CHANGED_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:92:(.text+0x11e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_CHANGED_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:94: undefined reference to__imp_ZOO_CHILD_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:94:(.text+0x12d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_CHILD_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:94: undefined reference to__imp_ZOO_SESSION_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:94:(.text+0x136): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_SESSION_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:98: undefined reference to__imp_ZOO_NOTWATCHING_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:98:(.text+0x14f): additional relocation overflows omitted from the output
cli_mt-cli.o: In function watcher': /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:117: undefined reference to__imp_ZOO_CONNECTED_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:136: undefined reference to __imp_ZOO_AUTH_FAILED_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:141: undefined reference to__imp_ZOO_EXPIRED_SESSION_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:143: undefined reference to __imp_zookeeper_close' cli_mt-cli.o: In functiontype2String':
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:95: undefined reference to __imp_ZOO_SESSION_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:89: undefined reference to__imp_ZOO_SESSION_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:91: undefined reference to __imp_ZOO_SESSION_EVENT' cli_mt-cli.o: In functionwatcher':
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:118: undefined reference to __imp_zoo_client_id' cli_mt-cli.o: In functionod_completion':
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:282: undefined reference to __imp_zoo_aset' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:282: undefined reference to__imp_zoo_aget'
cli_mt-cli.o: In function processline': /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:330: undefined reference to__imp_zoo_set_debug_level'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:367: undefined reference to __imp_zoo_set2' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:334: undefined reference to__imp_zoo_set_debug_level'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:390: undefined reference to __imp_zoo_aget_children2' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:344: undefined reference to__imp_zoo_aget'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:379: undefined reference to __imp_zoo_aget_children' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:363: undefined reference to__imp_zoo_aset'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:432: undefined reference to __imp_zoo_adelete' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:445: undefined reference to__imp_zoo_async'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:420: undefined reference to __imp_ZOO_OPEN_ACL_UNSAFE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:420: undefined reference to__imp_zoo_acreate'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:461: undefined reference to __imp_zoo_wexists' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:434: undefined reference to__imp_zoo_delete'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:478: undefined reference to __imp_zoo_exists' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:404: undefined reference to__imp_ZOO_SEQUENCE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:400: undefined reference to __imp_ZOO_EPHEMERAL' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:507: undefined reference to__imp_zoo_add_auth'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:484: undefined reference to __imp_zoo_client_id' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:496: undefined reference to__imp_zoo_aset'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:486: undefined reference to __imp_zookeeper_close' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:489: undefined reference to__imp_zookeeper_init'
cli_mt-cli.o: In function main': /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:567: undefined reference to__imp_zoo_set_debug_level'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:568: undefined reference to __imp_zoo_deterministic_conn_order' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:570: undefined reference to__imp_zookeeper_init'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:674: undefined reference to __imp_zookeeper_close' collect2: error: ld returned 1 exit status Makefile:604: recipe for targetcli_mt.exe' failed
make[1]: *** [cli_mt.exe] Error 1
make[1]: Leaving directory /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c' Makefile:468: recipe for targetall' failed
make: *** [all] Error 2

Really not sure why this is failing. Any insight on this issue would be greatly appreciated!

Thanks

Freshen up readme?

The README is really out of date:

  • the first section talks about fork safety (what?)
  • the second section talks about plans for 1.0 (huh?)
  • the install section is some gooblygook about rbenv and REE
  • I can't install this gem on Mavericks and I have no idea why.

As a new user who's trying to use the library, the current README is unhelpful. Perhaps a clean slate is called for?

ContinuationTimeoutErrors after upgrading on REE

Can you provide any more context for the following error? I've been seeing a lot of them since upgrading from 0.4.4 to 1.2.12. Surprised to see timeouts because the system has been using Zookeeper for quite a while before this change without a problem. Thanks for any insight/ideas.

Caught exception: Zookeeper::Exceptions::ContinuationTimeoutError
Exception Message: "response for meth: :exists, args: [32348, "/somenode", nil, nil], not received within 30 seconds"

Backtrace:
    /var/deploy/builder/shared/bundle/ruby/1.8/gems/zookeeper-1.2.12/lib/zookeeper/continuation.rb:115:in `value'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/deploy/builder/shared/bundle/ruby/1.8/gems/zookeeper-1.2.12/lib/zookeeper/continuation.rb:105:in `value'
/var/deploy/builder/shared/bundle/ruby/1.8/gems/zookeeper-1.2.12/ext/c_zookeeper.rb:216:in `submit_and_block'
/var/deploy/builder/shared/bundle/ruby/1.8/gems/zookeeper-1.2.12/ext/c_zookeeper.rb:40:in `exists'
/var/deploy/builder/shared/bundle/ruby/1.8/gems/zookeeper-1.2.12/lib/zookeeper/client_methods.rb:60:in `stat'
./lib/zookeeper_lock.rb:194:in `ensure_lock_exists'

Forking issues on REE

We just upgraded to the latest and it appears to have still have nasty issues with forking. I narrowed it down to this(don't have an isolated example): the parent process opens a zookeeper connection. It the forks and the child never uses the parent connection. The child at some point garbage-collects the zk handle in ruby that has the same C zk handle as the parent process. When doing so, it waits on a thread that never finishes.

We're running REE with merb, but I suspect the issue is universal and comes from threading+forking.

setting log on init

There is a commit comment for 0.4.2 about being able to set the log level on init, but the initialize() method does not take a log level or an option list.

Remove sleep from event delivery

Currently, the Ruby thread that waits for ZK events does a "sleep 0.1" to avoid busy-waiting. It would be nice to have a smarter way to notify the Ruby side that an event is available -- sleeping incurs a latency penalty.

With MRI 1.8, one way to do this is via a pipe and rb_thread_wait_fd()/rb_thread_select() -- use an extra pipe that Ruby can select() on, have a C thread that blocks waiting for new events, and have the C thread write a byte into the pipe when there's an event.

With MRI 1.9, I think you can use rb_thread_blocking_region() to get a similar effect in a somewhat cleaner way.

Anyone know of a better way to do this?

Expose reconfig calls from the API

Hello,

I'd like to use this gem to dynamically reconfigure my Zookeeper cluster in a chef cookbook, but it does not appear to expose the reconfig command. reconfig command allows an Admin to change dynamic configuration since zookeeper 3.5.2 and is explained in official doc.

I don't know if this is actually really missing from the gem or if there is another way to do it (maybe changing directly node content in /zookeeper/config ?). I can work a bit on this if you have any pointer to give?

Thanks for your help.

Gem won't install on windows?

This seems to be for a combination of problems. This includes lack of the commands tar and patch. It then tries to run a ./configure, which also doesn't work on windows. Is it possible to make it run on windows? Or am I missing something?

gem install zookeeper -v '1.4.8'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing zookeeper:
ERROR: Failed to build gem native extension.

C:/Ruby193/bin/ruby.exe extconf.rb

'tar' is not recognized as an internal or external command,
operable program or batch file.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby193/bin/ruby
extconf.rb:51:in safe_sh': command failed! tar xzf zkc-3.4.5.tar.gz 2>&1 (RuntimeError) from extconf.rb:62:inblock in

'
from extconf.rb:55:in chdir' from extconf.rb:55:in'
Building zkc.

won't install/compile under OS X 10.9

This gem tries to compile zookeeper but the compilation fails due to Clang not liking the C code: https://gist.github.com/anonymous/cfef0579fc2d64c9f6c5

I had the same issue when I compiled zookeeper with brew and I had to pass the following brew flag: --use-llvm
This flag tells brew use use llvm-gcc
https://github.com/mxcl/homebrew/blob/53fbb54af70dab089b48ecaeb14d179e6295d395/Library/Homebrew/superenv.rb#L94

Changing my rbconfig won't help because of:
https://github.com/slyphon/zookeeper/blob/master/ext/extconf.rb#L14

Ability to set session timeout

I can't see a way to set the session timeout right now other than altering the default one in the java base code.
It would be awesome if someone could make this possible ๐Ÿ‘

Couldn't change acls

I tried set acls.

$zk.get_acl (path: '/test/child')
=> {:req_id=>0, :rc=>0, :acl=>[{:perms=>15, :id=>{:scheme=>"world", :id=>"anyone"}}], :stat=>#<Zookeeper::Stat:0x007fbb62d3e0a8 @exists=true, @czxid=236, @mzxid=236, @ctime=1372998691325, @mtime=1372998691325, @version=0, @cversion=0, @aversion=0, @ephemeralOwner=0, @dataLength=0, @numChildren=0, @pzxid=236>}

$zk.set_acl(path: '/test/child', acl: [Zookeeper::ACLs::ACL.new(:perms => Zookeeper::Constants::ZOO_PERM_READ, :id => Zookeeper::Constants::ZOO_ANYONE_ID_UNSAFE)])
 => {:req_id=>4, :rc=>-102}

I think :perms shoud be 0(ZOO_PERM_READ). but it still 15(ZOO_PERM_ALL)

And I tried set acl while create new node.

$zk.create(path: "/test/child_2", acl: [Zookeeper::ACLs::ACL.new(:perms => Zookeeper::Constants::ZOO_PERM_READ, :id => Zookeeper::Constants::ZOO_ANYONE_ID_UNSAFE)])
 => {:req_id=>14, :rc=>0, :path=>"/test/child_2"}

$zk.get_acl(path: "/test/child_2")
 => {:req_id=>15, :rc=>0, :acl=>[{:perms=>0, :id=>{:scheme=>"world", :id=>"anyone"}}], :stat=>#<Zookeeper::Stat:0x007fbb62f68658 @exists=true, @czxid=368, @mzxid=368, @ctime=1373249714445, @mtime=1373249714445, @version=0, @cversion=0, @aversion=0, @ephemeralOwner=0, @dataLength=0, @numChildren=0, @pzxid=368>}

It works good.

Package current stable version 3.4.4

@grinser requested.

There's a non-trivial issue with testing this in jruby, in that there's a long delay in terms of connection teardown time. I'm going to have to take a closer look and possibly contact the zookeeper devs for assistance.

Publish java version to rubygems

In order to get the zk gem working with jruby I had to build the java version of this zookeeper gem myself and then upload it to our local gem server (using gem build zookeeper.gemspec)

If you were to build and publish zookeeper-1.4.11-java.gem to the rubygems.org server then this step would not be necessary (assuming one has internet access when installing ruby gems)

ACls permission dose not equal with zookeeper native defines.

I have had a problem related to permissions of ACLs.
I see the ACLs rule on zookeeper.

    public interface Perms {
        int READ = 1 << 0;
        int WRITE = 1 << 1;
        int CREATE = 1 << 2;
        int DELETE = 1 << 3;
        int ADMIN = 1 << 4;
        int ALL = READ | WRITE | CREATE | DELETE | ADMIN;
    }

It means READ = 1, WRITE = 2, CREATE = 4, DELETE = 8, ADMIN = 16, ALL = 31

But zookeeper gem ACLs defines does different with zookeper ACLs defines.

module Constants
    ZOO_PERM_READ   = 0
    ZOO_PERM_WRITE  = 1
    ZOO_PERM_CREATE = 2
    ZOO_PERM_DELETE = 4
    ZOO_PERM_ADMIN  = 8
    ZOO_PERM_ALL    = ZOO_PERM_READ | ZOO_PERM_WRITE | ZOO_PERM_CREATE | ZOO_PERM_DELETE | ZOO_PERM_ADMIN

It means READ = 0, WRITE = 1 ... Conflict with zookeeper native constants

I think, this is no problem if we set ACLs by zookeeper gem.
But in my case (set ACLs by zookeeper native) it was problem.

So I suggest change constants related to permission same with constants of zookeeper native.

Couldn't build c extention on joyent smartos(solaris based system)

I tried rake build In ext directory.
Error occurred at getpwuid_r systemcall.

make  all-am
make[1]: Entering directory `/root/zk/zookeeper/ext/c'
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I./include -I./tests -I./generated  -Wall -Werror  -g -O2 -D_GNU_SOURCE -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -D_GNU_SOURCE -c src/zookeeper.c  -fPIC -DPIC -o .libs/zookeeper.o
In file included from /usr/include/netinet/in.h:72:0,
                 from /usr/include/sys/socket.h:49,
                 from src/zookeeper.c:39:
/usr/include/sys/byteorder.h:96:17: error: conflicting types for 'htonll'
In file included from ./include/zookeeper.h:28:0,
                 from src/zookeeper.c:27:
./include/recordio.h:70:9: note: previous declaration of 'htonll' was here
src/zookeeper.c: In function 'log_env':
src/zookeeper.c:686:3: error: too many arguments to function 'getpwuid_r'
In file included from src/zookeeper.c:59:0:
/usr/include/pwd.h:191:23: note: declared here
make[1]: *** [zookeeper.lo] Error 1
make[1]: Leaving directory `/root/zk/zookeeper/ext/c'
make: *** [all] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Next, I tried using '-D_POSIX_C_SOURCE=199506L' to CPPFLAGS to avoid this.
Error didn't seen at getpwuid_r systemcall, but other several errors has occurred.

make  2>&1
make  all-am
make[1]: Entering directory `/root/zk/zookeeper/ext/c'
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I./include -I./tests -I./generated -D_POSIX_C_SOURCE=199506L -Wall -Werror  -g -O2 -D_GNU_SOURCE -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -D_POSIX_C_SOURCE=199506L -Wall -Werror -g -O2 -D_GNU_SOURCE -c src/zookeeper.c  -fPIC -DPIC -o .libs/zookeeper.o
In file included from src/zookeeper.c:27:0:
./include/zookeeper.h:390:9: error: 'struct timeval' declared inside parameter list [-Werror]
./include/zookeeper.h:390:9: error: its scope is only this definition or declaration, which is probably not what you want [-Werror]
In file included from src/zookeeper.c:30:0:
src/zk_adaptor.h:180:20: error: field 'last_recv' has incomplete type
src/zk_adaptor.h:181:20: error: field 'last_send' has incomplete type
src/zk_adaptor.h:182:20: error: field 'last_ping' has incomplete type
src/zk_adaptor.h:183:20: error: field 'next_deadline' has incomplete type
src/zk_adaptor.h:210:20: error: field 'socket_readable' has incomplete type
In file included from /usr/include/netinet/in.h:72:0,
                 from /usr/include/sys/socket.h:49,
                 from src/zookeeper.c:39:
/usr/include/sys/byteorder.h:96:17: error: conflicting types for 'htonll'
In file included from ./include/zookeeper.h:28:0,
                 from src/zookeeper.c:27:
./include/recordio.h:70:9: note: previous declaration of 'htonll' was here
src/zookeeper.c: In function 'setup_random':
src/zookeeper.c:403:5: error: implicit declaration of function 'srandom' [-Werror=implicit-function-declaration]
src/zookeeper.c: In function 'getaddrs':
src/zookeeper.c:432:5: error: implicit declaration of function 'strdup' [-Werror=implicit-function-declaration]
src/zookeeper.c:432:19: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c:607:20: error: implicit declaration of function 'random' [-Werror=implicit-function-declaration]
src/zookeeper.c: In function 'log_env':
src/zookeeper.c:661:3: error: implicit declaration of function 'gethostname' [-Werror=implicit-function-declaration]
src/zookeeper.c: In function 'zookeeper_init':
src/zookeeper.c:751:22: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c:764:24: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c: In function 'prepend_string':
src/zookeeper.c:825:16: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c: In function 'sub_string':
src/zookeeper.c:847:19: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c:850:15: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c: In function 'handle_socket_error_msg':
src/zookeeper.c:1162:9: error: implicit declaration of function 'vsnprintf' [-Werror=implicit-function-declaration]
src/zookeeper.c: In function 'calculate_interval':
src/zookeeper.c:1409:12: error: variable 'i' has initializer but incomplete type
src/zookeeper.c:1409:24: error: dereferencing pointer to incomplete type
src/zookeeper.c:1409:20: error: storage size of 'i' isn't known
src/zookeeper.c:1410:22: error: dereferencing pointer to incomplete type
src/zookeeper.c:1411:23: error: dereferencing pointer to incomplete type
src/zookeeper.c:1409:20: error: unused variable 'i' [-Werror=unused-variable]
src/zookeeper.c: At top level:
src/zookeeper.c:1416:23: error: return type is an incomplete type
src/zookeeper.c: In function 'get_timeval':
src/zookeeper.c:1418:20: error: storage size of 'tv' isn't known
src/zookeeper.c:1424:5: error: 'return' with a value, in function returning void [-Werror]
src/zookeeper.c:1418:20: error: unused variable 'tv' [-Werror=unused-variable]
src/zookeeper.c: In function 'send_ping':
src/zookeeper.c:1440:5: error: implicit declaration of function 'gettimeofday' [-Werror=implicit-function-declaration]
src/zookeeper.c: At top level:
src/zookeeper.c:1449:6: error: conflicting types for 'zookeeper_interest'
In file included from src/zookeeper.c:27:0:
./include/zookeeper.h:389:12: note: previous declaration of 'zookeeper_interest' was here
src/zookeeper.c: In function 'zookeeper_interest':
src/zookeeper.c:1452:20: error: storage size of 'now' isn't known
src/zookeeper.c:1466:7: error: dereferencing pointer to incomplete type
src/zookeeper.c:1467:7: error: dereferencing pointer to incomplete type
src/zookeeper.c:1510:9: error: dereferencing pointer to incomplete type
src/zookeeper.c:1526:13: error: dereferencing pointer to incomplete type
src/zookeeper.c:1547:9: error: dereferencing pointer to incomplete type
src/zookeeper.c:1548:51: error: dereferencing pointer to incomplete type
src/zookeeper.c:1549:53: error: dereferencing pointer to incomplete type
src/zookeeper.c:1452:20: error: unused variable 'now' [-Werror=unused-variable]
src/zookeeper.c: In function 'checkResponseLatency':
src/zookeeper.c:1869:20: error: storage size of 'now' isn't known
src/zookeeper.c:1869:20: error: unused variable 'now' [-Werror=unused-variable]
src/zookeeper.c: In function 'zookeeper_process':
src/zookeeper.c:1980:36: error: storage size of 'now' isn't known
src/zookeeper.c:1980:36: error: unused variable 'now' [-Werror=unused-variable]
src/zookeeper.c: In function 'create_watcher_registration':
src/zookeeper.c:2123:14: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c: In function 'flush_send_queue':
src/zookeeper.c:2822:20: error: storage size of 'started' isn't known
src/zookeeper.c:2833:28: error: storage size of 'now' isn't known
src/zookeeper.c:2833:28: error: unused variable 'now' [-Werror=unused-variable]
src/zookeeper.c:2822:20: error: unused variable 'started' [-Werror=unused-variable]
src/zookeeper.c: In function 'zoo_add_auth':
src/zookeeper.c:2960:22: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [zookeeper.lo] Error 1
make[1]: Leaving directory `/root/zk/zookeeper/ext/c'
make: *** [all] Error 2
*** extconf.rb failed ***

What should I do?

Is the log4j gem a hard requirement or does log4j just need to be on the classpath

When using jruby-gradle to build JRuby-based Storm topology jars that need to be uploaded into a running Storm cluster, I've got the challenge of log4j already being pulled in as a transitive dependency of other libraries for the topology jar.

I'm wondering if the require 'log4j' is necessary in java_base.rb or if the requirement is that log4j.jar is somewhere in the JVMs classpath

This is perhaps somewhat related #63

callbacks are not retained after a zookeper restart

Setup:

client code:

 require 'zookeeper'

ZK = Zookeeper.new('192.168.2.93:2181, 192.168.2.94:2181, 192.168.2.95:2181')

def set_callback(path)
  wcb = Zookeeper::WatcherCallback.new do
    puts "callback fired for #{path}"
    new_value = ZK.get(:path => path)[:data]
    puts "value changed to #{new_value}"
    set_callback(path)
  end
  ZK.stat(:path => path, :watcher => wcb)
end

#ZK.set_debug_level(Zookeeper::ZOO_LOG_LEVEL_DEBUG)
set_callback('/test')
ZK.set(:path => '/test', :data => '60')

changing node '/test' in one irb console fires the callback for both clients

restarting a zookeeper server:

  • all callbacks are fired (?> callback fired for /test)
  • the node has no value at this point (no output like "value changed to ..." )

after a restart of one zookeeper server the cease to fire...

the gist with irb output with debugging is here:
https://gist.github.com/807539

LoadError - undefined symbol: ZOOKEEPER_WRITE on CentOS/RHEL

I encountered this issue after:

  1. logged in as root
  2. install rvm
  3. install ruby 1.9.3-p374 thru rvm
  4. gem install --no-rdoc --no-ri zookeeper
  5. launch irb session:

require 'zookeeper'
LoadError: /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/ext/zookeeper_c.so: undefined symbol: ZOOKEEPER_WRITE - /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/ext/zookeeper_c.so
from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:26:in block in require_root' from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:25:ineach'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:25:in require_root' from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/ext/c_zookeeper.rb:8:in<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:26:in block in require_root' from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:25:ineach'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:25:in require_root' from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/ext/zookeeper_base.rb:3:in<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:26:in block in require_root' from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:25:ineach'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:25:in require_root' from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper/client.rb:8:in<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:18:in block in require_lib' from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:17:ineach'
from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:17:in require_lib' from /usr/local/rvm/gems/ruby-1.9.3-p374/gems/zookeeper-1.4.2/lib/zookeeper.rb:50:in<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in require' from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:inrescue in require'
from /usr/local/rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in require' from (irb):1 from /usr/local/rvm/rubies/ruby-1.9.3-p374/bin/irb:16:in

'>>

Transfer of zookeeper repo?

So, I've been maintaining a fork of twitter/zookeeper for about the past year. I've been doing regular releases, bugfixes, and code maintenance to keep Zookeeper running, and to support my higher-level Zookeeper wrapper ZK, which is now (I'm proud to say) powering redis_failover and is incorporated in dcell.

I wanted to ask: would twitter consider transferring this repository to me?

I've been stalling for months, hemming and hawing about filing a pull request. There are major changes I'd like to make (that would break the API, or at least the heirarchy), and I don't feel comforatable doing that unless I actually own the project. You can see from what the pull request would look like, it's a massive number of fixes. I've added proper chroot support, code generation tools to allow the C extension to do proper GIL release in 1.9.x (while maintaining 1.8.7 compatibility), more reliable eventmachine support, etc.

One advantage is that it'd be be more obvious to people where to file bugs (as my gem is starting to get more use), and I could more easily service the needs of users of the code.

So @wickman, @neilconway, @jmhodges: I care deeply about this codebase and have spent many many hours working on it. Would you consider allowing me to adopt this code?

[ERROR] (zkrb.c:834: errno: Bad file descriptor) select returned: -1

Every once in a while on long-running processes we see an infinite number of these messages until we restart the process:

[ERROR] (zkrb.c:834: errno: Bad file descriptor) select returned: -1

I noticed that the return value isn't checked in ext/zkrb.c:784:

  zookeeper_interest(zk->zh, &fd, &interest, &tv);

I would guess that that is the reason why ext/zkrb.c:808 is returning -1:

  rc = rb_thread_select(maxfd+1, &rfds, &wfds, &efds, &tv);

Backports causing issues with 1.8.7 project

We have a large project which we cannot upgrade to Ruby 1.9 because it uses Merb and other out-of-date dependencies. We have been on Zookeeper 0.4.4 but we were hoping to upgrade for obvious reasons. Version 0.9.6 works fine but the 1.0.0+ releases contain Backports which causes small failures in our test suite.

How much functionality relies on Backports? It is very dangerous to add Ruby 1.9 functionality to Ruby 1.8 apps (especially unknowingly) so I'd love to know how hard it would be to get rid of the Backports dependency.

inconsistent names/paths in node creation after chroot

here's what i'm trying:

irb(main):009:0> zk = Zookeeper.new('localhost:2181/test/service')
... lots of output ...
irb(main):010:0> zk.create(:path => 'a', :ephemeral => true, :sequence => true)
=> {:req_id=>0, :rc=>0, :path=>"0000000006"}
irb(main):011:0> zk.create(:path => '/', :ephemeral => true, :sequence => true)
=> {:req_id=>1, :rc=>0, :path=>"0000000007"}
irb(main):012:0> zk.create(:path => 'b', :ephemeral => true, :sequence => true)
=> {:req_id=>2, :rc=>0, :path=>"0000000008"}
irb(main):013:0> zk.create(:path => 'bc', :ephemeral => true, :sequence => true)
=> {:req_id=>3, :rc=>0, :path=>"bc0000000009"}
irb(main):014:0> zk.create(:path => '', :ephemeral => true, :sequence => true)
=> {:req_id=>4, :rc=>0, :path=>"0000000010"}

before i start, here is the state in zkCli:

[zk: localhost:2181(CONNECTED) 24] ls /test
[service]
[zk: localhost:2181(CONNECTED) 25] ls /test/service
[]

i expect that after i'm done, i should contain a state like this:

[zk: localhost:2181(CONNECTED) 24] ls /test
[service]
[zk: localhost:2181(CONNECTED) 25] ls /test/service
[a0000000006, 0000000007, b0000000008, bc0000000009, 0000000010]

in other words, because I chrooted, i should have all my nodes created under /test/service and the characters i put into the :path argument should be pre-pended to the sequential key name.

instead, here is what i get:

[zk: localhost:2181(CONNECTED) 28] ls /test
[service, servicebc0000000009, service0000000008, service0000000007, service0000000010, service0000000006]
[zk: localhost:2181(CONNECTED) 30] ls /test/service
[]

none of my nodes got created under /test/service; additionally, if i just use a single character as a path, that character disappears (like a and b but not bc).

on the other hand, if i set a path like /a, then i get the right behavior, with a node under /test/service called a00000000001.

am i doing something wrong? i reported a this bug also under zk-ruby/zk#77 but maybe it belongs even further upstream?

Locking in ZookeeperBase#create()

I've noticed that ZookeeperBase#create() is locking:

  def create(*args)
    # since we don't care about the inputs, just glob args
    rc, new_path = @mutex.synchronize { @czk.create(*args) }
    [rc, strip_chroot_from(new_path)]
  end

but the def_delegators for all of the other methods don't have any such protection.

It seems like:

  1. all of the methods should have some sort of consistent locking โ€” it may be that it just needs to have a lock when it dereferences @zkc
  2. in general, it looks like calling Continuation#value should only be called outside of all locks (it does look like CZookeeper#submit_and_block() is unlocking everything like it should), but if there are any cases where we do need to hold other locks, it may make sense to return the Continuation to block after the lock has been unlocked

Unlocking the ZookeeperBase mutex before calling @zkc.create() should fix the deadlock I found earlier today.

undefined symbol: pthread_key_create

zookeeper-0.4.4/lib/zookeeper_c.so: undefined symbol: pthread_key_create

working fine on OSX but throwing this error on CentOS.

will post more info as i dig through it.

Memory leak?

I wrote a snippet with zookeeper gem, and got some kind of memory leak problem.

Ruby version:

ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin12.0]

Gem version:

zookeeper (1.4.8)

Zookeeper server installed with Homebrew:

zookeeper: stable 3.4.6 (bottled), HEAD
$ irb
irb(main):001:0> require 'zookeeper'
=> true
irb(main):002:0> cli = Zookeeper.new("localhost:2181")
=> #<Zookeeper::Client:0x007fd7648aedd0 @host="localhost:2181", ...

At this time, I see this irb process uses 12.4MB memory with Activity Monitor on OS X.
And I run the following code:

rb(main):003:0> loop { cli.get_chidldren(path: "/") }

Then the memory size rises and rises to 17.1MB beyond 12.4MB while running.
I stop this infinite loop with Ctrl+C after about 10 second from starting, but Activity Monitor keeps showing 17.1MB.

Is this some memory leak? Or another reason?

Zookeeper fails to compile on Alpine >= 3.13

As tested, Zookeeper will fail to compile on Alpine versions 3.13 or above, with the error configure: error: cannot guess build type; you must specify one

Updating the config.guess and config.sub of the project as the error message suggests to do does resolve the problem:

It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

zookeeper zk doesn't support ttl container nodes

Hi Guys

ttl and container nodes was add in zookeeper 3.5.3

[zk: localhost:2181(CONNECTED) 0] create -t 20 /xxx
Created /xxx
[zk: localhost:2181(CONNECTED) 1] create -c /bbb
Created /bbb

2.4.5 :017 > @z = ::ZK.new("127.0.0.1:2181")
=> #<ZK::Client::Threaded:39575600 zk_session_id=0x10164caa7180003 ...>
2.4.5 :020 > @z.create "/v" , :t => 20
Traceback (most recent call last):
1: from (irb):20
Zookeeper::Exceptions::BadArguments (Supported arguments are: [:path, :data, :acl, :ephemeral, :sequence, :callback, :callback_context], but arguments [:path, :data, :ephemeral, :sequence, :t] were supplied instead)
2.4.5 :020 > @z.create "/v" , :c => 20
Traceback (most recent call last):
1: from (irb):20
Zookeeper::Exceptions::BadArguments (Supported arguments are: [:path, :data, :acl, :ephemeral, :sequence, :callback, :callback_context], but arguments [:path, :data, :ephemeral, :sequence, :c] were supplied instead)

Make failed for zkc while linking

On my system gem install zookeeper fails with:

linking shared-object zookeeper_c.so
/home/ullrich/.gem/ruby/1.9.1/gems/zookeeper-1.4.8/ext/lib/libzookeeper_st_gem.a(hashtable.o): In function `create_hashtable':
/home/ullrich/.gem/ruby/1.9.1/gems/zookeeper-1.4.8/ext/zkc-3.4.5/c/src/hashtable/hashtable.c:51: undefined reference to `ceilf'
/home/ullrich/.gem/ruby/1.9.1/gems/zookeeper-1.4.8/ext/lib/libzookeeper_st_gem.a(hashtable.o): In function `hashtable_expand':
/home/ullrich/.gem/ruby/1.9.1/gems/zookeeper-1.4.8/ext/zkc-3.4.5/c/src/hashtable/hashtable.c:124: undefined reference to `ceilf'
collect2: ld returned 1 exit status
make: *** [zookeeper_c.so] Error 1

I was able to get it compiling by hand when changing the order for the linker to have -lm after -lzookeeper_st_gem in the Makefile.

I am unsure what can be broken here. Any Ideas?

Can't install with ruby 1.9.3

gem install zookeeper -v '1.4.6'
Building native extensions.  This could take a while...
ERROR:  Error installing zookeeper:
        ERROR: Failed to build gem native extension.

        /opt/rubies/1.9.3-p545/bin/ruby extconf.rb
Building zkc.
tar xzf zkc-3.4.5.tar.gz 2>&1
patch -p0 < patches/zkc-3.4.5-logging.patch 2>&1
patching file zkc-3.4.5/c/src/zookeeper.c
./configure --prefix=/Users/adam/.gem/ruby/1.9.3/gems/zookeeper-1.4.6/ext --with-pic --without-cppunit --disable-dependency-tracking  2>&1
checking for doxygen... no
checking for perl... /usr/bin/perl
checking for dot... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for generated/zookeeper.jute.c... yes
checking for generated/zookeeper.jute.h... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking build system type... i686-apple-darwin14.1.0
checking host system type... i686-apple-darwin14.1.0
checking for a sed that does not truncate output... /usr/bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from gcc object... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
checking if gcc supports -fno-rtti -fno-exceptions... rm: conftest.dSYM: is a directory
yes
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... rm: conftest.dSYM: is a directory
yes
checking if gcc static flag -static works... rm: conftest.dSYM: is a directory
no
checking if gcc supports -c -o file.o... rm: conftest.dSYM: is a directory
yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.1.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... rm: conftest.dSYM: is a directory
yes
checking if g++ static flag -static works... rm: conftest.dSYM: is a directory
no
checking if g++ supports -c -o file.o... rm: conftest.dSYM: is a directory
yes
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.1.0 dyld
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for pthread_mutex_lock in -lpthread... yes
configure: building with SyncAPI support
checking for ANSI C header files... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking for nfds_t... yes
checking whether to enable ipv6... yes
checking for getcwd... yes
checking for gethostbyname... yes
checking for gethostname... yes
checking for getlogin... yes
checking for getpwuid_r... yes
checking for gettimeofday... yes
checking for getuid... yes
checking for memmove... yes
checking for memset... yes
checking for poll... yes
checking for socket... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strtol... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
make  2>&1
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.  -I./include -I./tests -I./generated  -Wall -Werror  -g -O2 -D_GNU_SOURCE -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -D_GNU_SOURCE -c src/zookeeper.c  -fno-common -DPIC -o .libs/zookeeper.o
In file included from src/zookeeper.c:27:
In file included from ./include/zookeeper.h:34:
./include/recordio.h:76:9: error: expected ')'
int64_t htonll(int64_t v);
        ^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:30: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
                             ^
./include/recordio.h:76:9: note: to match this '('
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
    ^
In file included from src/zookeeper.c:27:
In file included from ./include/zookeeper.h:34:
./include/recordio.h:76:9: error: conflicting types for '__builtin_constant_p'
int64_t htonll(int64_t v);
        ^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
     ^
./include/recordio.h:76:9: note: '__builtin_constant_p' is a builtin with type 'int ()'
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
     ^
2 errors generated.
make[1]: *** [zookeeper.lo] Error 1
make: *** [all] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/opt/rubies/1.9.3-p545/bin/ruby
extconf.rb:51:in `safe_sh': command failed! make  2>&1 (RuntimeError)
        from extconf.rb:76:in `block (2 levels) in <main>'
        from extconf.rb:71:in `chdir'
        from extconf.rb:71:in `block in <main>'
        from extconf.rb:55:in `chdir'
        from extconf.rb:55:in `<main>'


Gem files will remain installed in /Users/adam/.gem/ruby/1.9.3/gems/zookeeper-1.4.6 for inspection.
Results logged to /Users/adam/.gem/ruby/1.9.3/gems/zookeeper-1.4.6/ext/gem_make.out

I built ruby like so:

CONFIGURE_OPTS='--enable-shared --disable-install-doc' sudo ruby-build 1.9.3-p545 /opt/rubies/1.9.3-p545

get_children does not seem to work with an ensemble of 5 servers

I'm attempting to call get_children from the ruby client on a zookeeper ensemble of 5 servers.

When calling from the ruby client, I am getting a :rc of -7, which seems to indicate a timeout.

get_children works from the python client (https://github.com/phunt/zk-smoketest) and the java client (using zkCli.sh).

Here are the log entries I am getting:

2011-05-18 18:14:56,788 - INFO  [NIOServerCxn.Factory:2181:NIOServerCnxn@639] - Creating new session 0x2fe336b7ae0024
2011-05-18 18:14:56,790 - INFO  [CommitProcessor:0:NIOServerCnxn@992] - Finished init of 0x2fe336b7ae0024 valid:true
2011-05-18 18:14:56,845 - INFO  [NIOServerCxn.Factory:2181:NIOServerCnxn@607] - Connected to /10.162.157.123:58917 lastZxid 0
2011-05-18 18:14:56,845 - INFO  [NIOServerCxn.Factory:2181:NIOServerCnxn@639] - Creating new session 0x2fe336b7ae0025
2011-05-18 18:14:56,846 - INFO  [CommitProcessor:0:NIOServerCnxn@992] - Finished init of 0x2fe336b7ae0025 valid:true
2011-05-18 18:14:56,858 - WARN  [NIOServerCxn.Factory:2181:NIOServerCnxn@518] - Exception causing close of session 0x2fe336b7ae0025 due to java.io.IOException: Read error
2011-05-18 18:14:56,858 - INFO  [NIOServerCxn.Factory:2181:NIOServerCnxn@857] - closing session:0x2fe336b7ae0025 NIOServerCnxn: java.nio.channels.SocketChannel[connected local=/10.1
62.151.144:2181 remote=/10.162.157.123:58917]
2011-05-18 18:14:56,858 - INFO  [ProcessThread:-1:PrepRequestProcessor@384] - Processed session termination request for id: 0x2fe336b7ae0025
2011-05-18 18:14:56,873 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x12fe336b7b60016 type:sync: cxid:0x4dd40ca7 zxid:0xfffffffffff
ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:56,876 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x22fe336b7ca000e type:sync: cxid:0x4dd40ca9 zxid:0xfffffffffff
ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:56,880 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x32fe3372411000c type:sync: cxid:0x4dd40cab zxid:0xfffffffffff
ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:56,884 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x42fe336bba3000e type:sync: cxid:0x4dd40cad zxid:0xfffffffffff
ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:56,891 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x12fe336b7b60016 type:sync: cxid:0x4dd40cb6 zxid:0xfffffffffff
ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:56,895 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x22fe336b7ca000e type:sync: cxid:0x4dd40cbd zxid:0xfffffffffff  38927 ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:56,900 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x32fe3372411000c type:sync: cxid:0x4dd40cc4 zxid:0xfffffffffff  38932 ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:56,905 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x42fe336bba3000e type:sync: cxid:0x4dd40ccb zxid:0xfffffffffff  38937 ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:57,945 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x12fe336b7b60016 type:sync: cxid:0x4dd40cd8 zxid:0xfffffffffff  38942 ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:57,945 - WARN  [NIOServerCxn.Factory:2181:NIOServerCnxn@518] - Exception causing close of session 0x2fe336b7ae0024 due to java.io.IOException: Read error
2011-05-18 18:14:57,945 - WARN  [ProcessThread:-1:PrepRequestProcessor@402] - Got exception when processing sessionid:0x32fe3372411000c type:sync: cxid:0x4dd40cda zxid:0xfffffffffff  38948 ffffe txntype:unknown /
org.apache.zookeeper.KeeperException$SessionMovedException: KeeperErrorCode = Session moved
        at org.apache.zookeeper.server.SessionTrackerImpl.checkSession(SessionTrackerImpl.java:231)
        at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:394)
        at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114)
2011-05-18 18:14:57,945 - INFO  [NIOServerCxn.Factory:2181:NIOServerCnxn@857] - closing session:0x2fe336b7ae0024 NIOServerCnxn: java.nio.channels.SocketChannel[connected local=/10.1  38953 62.151.144:2181 remote=/10.162.157.123:58912]
2011-05-18 18:14:57,946 - INFO  [ProcessThread:-1:PrepRequestProcessor@384] - Processed session termination request for id: 0x2fe336b7ae0024

ArgumentError - too large fdsets:

I've recently started to see this error occurs with some frequency. Ruby version is ruby 1.9.3p484. Error stack is:

ArgumentError - too large fdsets:
/root/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.8/ext/c_zookeeper.rb:282:in zkrb_iterate_event_loop' /root/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.8/ext/c_zookeeper.rb:282:inevent_thread_body'
/root/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in call' /root/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:inblock in create_with_logging_context'

Any idea what this means? Any guidance would be helpful -- Thanks in advance

New gem release?

It seems like the 1.4.11 release was done in September, 2015, but there have been a few minor fixes merged into master, #86 and #82 for example. With the latter I was able to build this gem on an M1 Apple Silicon Mac. Would it be possible to cut a new release for supporting installing on new Mac hardware?

support multi operation

Hi,

zookeeper since 3.4.0 has a multi operation, which:

Executes multiple ZooKeeper operations or none of them. 

Are there any plans to integrate this into this gem? Or are there fundamental problems, that would prevent that?

Failure to install on OS X 10.10 Yosemite

gcc --version
gcc (Homebrew gcc 4.9.1) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ --version
g++ (Homebrew gcc 4.9.1) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gem install zookeeper -v '1.4.8'
Building native extensions.  This could take a while...
ERROR:  Error installing zookeeper:
    ERROR: Failed to build gem native extension.

        /Users/rholzmann/.rbenv/versions/1.9.3-p448/bin/ruby extconf.rb
Building zkc.
tar xzf zkc-3.4.5.tar.gz 2>&1
patch -p0 < patches/zkc-3.4.5-logging.patch 2>&1
patching file zkc-3.4.5/c/src/zookeeper.c
./configure --prefix=/Users/rholzmann/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.8/ext --with-pic --without-cppunit --disable-dependency-tracking  2>&1
checking for doxygen... no
checking for perl... /usr/bin/perl
checking for dot... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for generated/zookeeper.jute.c... yes
checking for generated/zookeeper.jute.h... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking build system type... i686-apple-darwin14.0.0
checking host system type... i686-apple-darwin14.0.0
checking for a sed that does not truncate output... /usr/bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.0.0 dyld
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gfortran option to produce PIC... -fno-common
checking if gfortran PIC flag -fno-common works... yes
checking if gfortran static flag -static works... no
checking if gfortran supports -c -o file.o... yes
checking whether the gfortran linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking for pthread_mutex_lock in -lpthread... yes
configure: building with SyncAPI support
checking for ANSI C header files... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking for nfds_t... yes
checking whether to enable ipv6... yes
checking for getcwd... yes
checking for gethostbyname... yes
checking for gethostname... yes
checking for getlogin... yes
checking for getpwuid_r... yes
checking for gettimeofday... yes
checking for getuid... yes
checking for memmove... yes
checking for memset... yes
checking for poll... yes
checking for socket... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strtol... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
make  2>&1
/Library/Developer/CommandLineTools/usr/bin/make  all-am
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.  -I./include -I./tests -I./generated  -Wall -Werror  -g -O2 -D_GNU_SOURCE -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -D_GNU_SOURCE -c src/zookeeper.c  -fno-common -DPIC -o .libs/zookeeper.o
In file included from /usr/include/sys/_endian.h:130:0,
                 from /usr/include/i386/endian.h:99,
                 from /usr/include/machine/endian.h:35,
                 from /usr/include/sys/wait.h:186,
                 from /usr/include/stdlib.h:65,
                 from ./include/zookeeper.h:22,
                 from src/zookeeper.c:27:
./include/recordio.h:76:9: error: expected ')' before '?' token
 int64_t htonll(int64_t v);
         ^
make[1]: *** [zookeeper.lo] Error 1
make: *** [all] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/rholzmann/.rbenv/versions/1.9.3-p448/bin/ruby
extconf.rb:51:in `safe_sh': command failed! make  2>&1 (RuntimeError)
    from extconf.rb:76:in `block (2 levels) in <main>'
    from extconf.rb:71:in `chdir'
    from extconf.rb:71:in `block in <main>'
    from extconf.rb:55:in `chdir'
    from extconf.rb:55:in `<main>'


Gem files will remain installed in /Users/rholzmann/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.8 for inspection.
Results logged to /Users/rholzmann/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.8/ext/gem_make.out

Any insight appreciated. I've tried gcc-4.2 as well, no luck.

Zookeeper.new blows up if any host cannot be resolved

If I pass multiple hosts to Zookeeper.new, then I get an exception if any of the hosts cannot be resolved. However, I connect successfully if the hosts do not have Zookeeper but I can resolve them. Finally, I get failures when connecting to unreachable hosts that can be resolved when they are remote (which is what I would expect) but I get back a Zookeeper::Client object if I connect to non-existent Zookeepers on localhost.

For example, if I have Zookeeper running on localhost:2181

Zookeeper.new('localhost:2181,a:2181')
=> RuntimeError: error connecting to zookeeper: 2

Zookeeper.new('localhost:2181,google.com:2181')
=> #<Zookeeper::Client:0x1106c3228 @host="localhost:2181,google.com:2181"...>

Zookeeper.new("localhost:1,localhost:2")
=> #<Zookeeper::Client:0x110d73578 @host="localhost:1,localhost:2"...>

I'm not sure if this is intended behavior but it caught me by surprise.

Compilation Error with GCC 8

Gem compiles fine with GCC 7 but fails with GCC 8 with this error. It is reproducible on Ruby 2.4 as well as 2.3:

make  2>&1
make  all-am
make[1]: Entering directory '$HOME/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/zookeeper-1.4.11/ext/zkc-3.4.5/c'
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.  -I./include -I./tests -I./generated  -Wall -Werror  -g -O2 -D_GNU_SOURCE -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -D_GNU_SOURCE -c src/zookeeper.c  -fPIC -DPIC -o .libs/zookeeper.o
src/zookeeper.c: In function 'format_endpoint_info':
src/zookeeper.c:3440:21: error: '%d' directive writing between 1 and 5 bytes into a region of size between 0 and 127 [-Werror=format-overflow=]
     sprintf(buf,"%s:%d",addrstr,ntohs(port));
                     ^~
src/zookeeper.c:3440:17: note: directive argument in the range [0, 65535]
     sprintf(buf,"%s:%d",addrstr,ntohs(port));
                 ^~~~~~~
src/zookeeper.c:3440:5: note: 'sprintf' output between 3 and 134 bytes into a destination of size 128
     sprintf(buf,"%s:%d",addrstr,ntohs(port));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:754: zookeeper.lo] Error 1
make[1]: Leaving directory '$HOME/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/zookeeper-1.4.11/ext/zkc-3.4.5/c'
make: *** [Makefile:468: all] Error 2
*** extconf.rb failed ***

Handle failures from zookeeper_interest()

I started to notice these log messages happening in my logs from time to time:

[ERROR] (zkrb.c:834: errno: Bad file descriptor) select returned: -1

at a rate of hundreds per second.

In attempting to diagnose the problem, I deployed this additional error checking and found that it looks like we aren't handling failures from zookeeper_interest() properly.

When I ran the patch, I got this exception:

ext/c_zookeeper.rb:262:in `zkrb_iterate_event_loop': zookeeper_interest failed: -7: operation timeout (RuntimeError)

I'm not sure what the impact of having zookeeper_interest return ZOPERATIONTIMEOUT is, but it seems to me that it wouldn't be good.

I'm still investigating the correct behavior when we get a failure from zookeeper_interest().

Zookeeper logger throws exception on Windows/JRuby

I don't know if there is a way to set the logger, but with JRuby on windows I get an exception the following Logger.new:

lib\ruby\gems\1.8\gems\slyphon-zookeeper-0.9.2-java\lib\zookeeper.rb
class Zookeeper < ZookeeperBase
unless defined?(@@logger)
@@logger = Logger.new('/dev/null').tap { |l| l.level = Logger::FATAL } # UNIX: FOR GREAT JUSTICE !!
end

$ jruby -v
jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) Client VM 1.6.0_31) [Windows Server 2008 R2-x86-java]

Exception outpout:

Errno::ENOENT: No such file or directory - c:/dev/null
initialize at org/jruby/RubyFile.java:465
open at org/jruby/RubyIO.java:1135
open at org/jruby/RubyKernel.java:287
open at org/jruby/RubyKernel.java:297
create_logfile at c:/jruby/jruby-1.6.7/lib/ruby/1.9/logger.rb:549
open_logfile at c:/jruby/jruby-1.6.7/lib/ruby/1.9/logger.rb:544
initialize at c:/jruby/jruby-1.6.7/lib/ruby/1.9/logger.rb:499
initialize at c:/jruby/jruby-1.6.7/lib/ruby/1.9/logger.rb:275
Zookeeper at c:/jruby/jruby-1.6.7/lib/ruby/gems/1.8/gems/slyphon-zookeepe
r-0.9.2-java/lib/zookeeper.rb:26
(root) at c:/jruby/jruby-1.6.7/lib/ruby/gems/1.8/gems/slyphon-zookeepe
r-0.9.2-java/lib/zookeeper.rb:24
require at org/jruby/RubyKernel.java:1042
(root) at c:/jruby/jruby-1.6.7/lib/ruby/gems/1.8/gems/slyphon-zookeepe
r-0.9.2-java/lib/zookeeper.rb:7

Does we have a solution to build zookeeper on os x yosemite 10.10.5

Installing zookeeper 1.3.0 with native extensions

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/spodichetti/.rbenv/versions/1.9.3-p385/bin/ruby extconf.rb

Building zkc.
tar xzf zkc-3.3.5.tar.gz 2>&1
./configure --prefix=/Users/spodichetti/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/zookeeper-1.3.0/ext --with-pic --without-cppunit --disable-dependency-tracking 2>&1
checking for doxygen... no
checking for perl... /usr/bin/perl
checking for dot... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for generated/zookeeper.jute.c... yes
checking for generated/zookeeper.jute.h... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking whether ln -s works... yes
checking build system type... x86_64-apple-darwin14.5.0
checking host system type... x86_64-apple-darwin14.5.0
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin14.5.0 file names to x86_64-apple-darwin14.5.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin14.5.0 file names to toolchain format... func_convert_file_noop
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common -DPIC
checking if g++ PIC flag -fno-common -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking for pthread_mutex_lock in -lpthread... yes
configure: building with SyncAPI support
checking for ANSI C header files... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking for nfds_t... yes
checking whether to enable ipv6... yes
checking for getcwd... yes
checking for gethostbyname... yes
checking for gethostname... yes
checking for getlogin... yes
checking for getpwuid_r... yes
checking for gettimeofday... yes
checking for getuid... yes
checking for memmove... yes
checking for memset... yes
checking for poll... yes
checking for socket... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strtol... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make 2>&1
/Library/Developer/CommandLineTools/usr/bin/make all-am
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -D_GNU_SOURCE -c -o zookeeper.lo test -f 'src/zookeeper.c' || echo './'src/zookeeper.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -D_GNU_SOURCE -c src/zookeeper.c -fno-common -DPIC -o .libs/zookeeper.o
In file included from src/zookeeper.c:27:
In file included from ./include/zookeeper.h:28:
./include/recordio.h:70:9: error: expected ')'
int64_t htonll(int64_t v);
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'

define htonll(x) __DARWIN_OSSwapInt64(x)

                    ^

/usr/include/libkern/_OSByteOrder.h:78:30: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
./include/recordio.h:70:9: note: to match this '('
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'

define htonll(x) __DARWIN_OSSwapInt64(x)

                    ^

/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
In file included from src/zookeeper.c:27:
In file included from ./include/zookeeper.h:28:
./include/recordio.h:70:9: error: conflicting types for '__builtin_constant_p'
int64_t htonll(int64_t v);
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'

define htonll(x) __DARWIN_OSSwapInt64(x)

                    ^

/usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
./include/recordio.h:70:9: note: '__builtin_constant_p' is a builtin with type 'int ()'
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'

define htonll(x) __DARWIN_OSSwapInt64(x)

                    ^

/usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
src/zookeeper.c:724:46: error: comparison of array 'clientid->passwd' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
((clientid == 0) || (clientid->passwd == 0) ?
~~~~~~~~~~^~~~~~ ~
./include/zookeeper_log.h:36:73: note: expanded from macro 'LOG_INFO'
log_message(ZOO_LOG_LEVEL_INFO,LINE,func,format_log_message x)
^
src/zookeeper.c:840:61: error: size argument in 'strncmp' call is a comparison [-Werror,-Wmemsize-comparison]
if (strncmp(server_path, zh->chroot, strlen(zh->chroot) != 0)) {
~~~~~~~~~~~~~~~~~~~^~~~
src/zookeeper.c:840:9: note: did you mean to compare the result of 'strncmp' instead?
if (strncmp(server_path, zh->chroot, strlen(zh->chroot) != 0)) {
^ ~
)
src/zookeeper.c:840:42: note: explicitly cast the argument to size_t to silence this warning
if (strncmp(server_path, zh->chroot, strlen(zh->chroot) != 0)) {
^
(size_t)( )
4 errors generated.
make[1]: *** [zookeeper.lo] Error 1
make: *** [all] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/spodichetti/.rbenv/versions/1.9.3-p385/bin/ruby
extconf.rb:49:in safe_sh': command failed! make 2>&1 (RuntimeError) from extconf.rb:72:inblock (2 levels) in

'
from extconf.rb:67:in chdir' from extconf.rb:67:inblock in '
from extconf.rb:53:in chdir' from extconf.rb:53:in'

Gem files will remain installed in /Users/spodichetti/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/zookeeper-1.3.0 for inspection.
Results logged to /Users/spodichetti/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/zookeeper-1.3.0/ext/gem_make.out

Segfault

I'm trying to debug an issue where my background workers inevitably hang. I suspected that this has something to do with zookeeper (i use redis_failover gem). Here's what I got when shortly after I started my sidekiq server

/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/thread.rb:86: [BUG] Segmentation fault
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0009 p:---- s:0035 b:0029 l:000028 d:000028 CFUNC  :inspect
c:0008 p:---- s:0027 b:0027 l:000026 d:000026 FINISH
c:0007 p:---- s:0025 b:0025 l:000024 d:000024 CFUNC  :call
c:0006 p:0015 s:0021 b:0021 l:000020 d:000020 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/lib/zookeeper/callbacks.rb:32
c:0005 p:0211 s:0017 b:0017 l:000016 d:000016 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/lib/zookeeper/common.rb:81
c:0004 p:0028 s:0010 b:0010 l:000009 d:000009 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/lib/zookeeper/common.rb:94
c:0003 p:---- s:0006 b:0006 l:000005 d:000005 FINISH
c:0002 p:---- s:0004 b:0004 l:001510 d:000003 IFUNC 
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP   

-- Ruby level backtrace information ----------------------------------------
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/lib/zookeeper/common.rb:94:in `dispatch_thread_body'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/lib/zookeeper/common.rb:56:in `get_next_event'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/lib/zookeeper/common/queue_with_pipe.rb:59:in `pop'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/thread.rb:71:in `wait'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/thread.rb:71:in `sleep'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/thread.rb:71:in `unlock'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/thread.rb:71:in `push'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/event_handler.rb:315:in `block in watcher_callback'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/event_handler.rb:190:in `process'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/event_handler.rb:338:in `safe_call'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/event_handler.rb:338:in `each'

-- C level backtrace information -------------------------------------------
2012-12-20 08:07:05 UTC RedisFailover 12619 INFO: Purging current redis clients
SEGV received in SEGV handler
Aborted

And here's another one (should I post it as a separate issue?)

/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/ext/c_zookeeper.rb:311: [BUG] Segmentation fault
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0030 p:---- s:0120 b:0120 l:000119 d:000119 CFUNC  :to_f
c:0029 p:0064 s:0117 b:0117 l:000110 d:000116 BLOCK  /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/lib/zookeeper/continuation.rb:112
c:0028 p:0019 s:0115 b:0114 l:000113 d:000113 METHOD /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/monitor.rb:211
c:0027 p:0044 s:0111 b:0111 l:000110 d:000110 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/lib/zookeeper/continuation.rb:107
c:0026 p:---- s:0102 b:0102 l:000101 d:000101 CFUNC  :delete_if
c:0025 p:0045 s:0099 b:0099 l:000095 d:000098 BLOCK  /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/forwardable.rb:203
c:0024 p:0026 s:0096 b:0096 l:000095 d:000095 METHOD /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/forwardable.rb:200
c:0023 p:0082 s:0091 b:0091 l:000090 d:000090 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zookeeper-1.3.0/lib/zookeeper/client_methods.rb:82
c:0022 p:0082 s:0083 b:0083 l:000082 d:000082 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/client/base.rb:1055
c:0021 p:0042 s:0076 b:0076 l:000075 d:000075 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/client/threaded.rb:579
c:0020 p:0026 s:0068 b:0068 l:000c10 d:000067 BLOCK  /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/client/base.rb:623
c:0019 p:0087 s:0065 b:0065 l:000052 d:000064 BLOCK  /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/event_handler.rb:304
c:0018 p:0005 s:0061 b:0061 l:000055 d:000060 BLOCK  /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/event_handler.rb:311
c:0017 p:0029 s:0060 b:0059 l:000058 d:000058 METHOD /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/monitor.rb:213
c:0016 p:0013 s:0056 b:0056 l:000055 d:000055 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/event_handler.rb:311
c:0015 p:---- s:0056 b:0059 l:000058 d:000058 CFUNC  :===
c:0014 p:---- s:0051 b:0051 l:000050 d:000050 FINISH
c:0013 p:---- s:0049 b:0049 l:000048 d:000048 CFUNC  :new
c:0012 p:0165 s:0045 b:0045 l:000037 d:000044 BLOCK  /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:66
c:0011 p:0019 s:0041 b:0041 l:000040 d:000040 METHOD <internal:prelude>:10
c:0010 p:0080 s:0038 b:0038 l:000037 d:000037 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:51
c:0009 p:0049 s:0032 b:0032 l:000031 d:000031 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/logging.rb:9
c:0008 p:0017 s:0029 b:0029 l:000028 d:000028 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/logging.rb:32
c:0007 p:0032 s:0026 b:0026 l:000025 d:000025 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/threadpool.rb:228
c:0006 p:0038 s:0021 b:0021 l:000020 d:000020 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/threadpool.rb:207
c:0005 p:0034 s:0014 b:0014 l:000010 d:000013 BLOCK  /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/threadpool.rb:281
c:0004 p:0155 s:0011 b:0011 l:000010 d:000010 METHOD /srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/threadpool.rb:278
c:0003 p:---- s:0006 b:0006 l:000005 d:000005 FINISH
c:0002 p:---- s:0004 b:0004 l:000a90 d:000003 IFUNC 
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP   

-- Ruby level backtrace information ----------------------------------------
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/threadpool.rb:278:in `worker_thread_body'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/threadpool.rb:281:in `rescue in worker_thread_body'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/threadpool.rb:207:in `dispatch_to_error_handler'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/threadpool.rb:228:in `default_exception_handler'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/logging.rb:32:in `logger'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/zk-1.7.4/lib/zk/logging.rb:9:in `logger'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:51:in `new'
<internal:prelude>:10:in `synchronize'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:66:in `block in new'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:66:in `new'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:158:in `initialize'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:451:in `_setup'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:99:in `define_log_methods'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:99:in `each'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:100:in `block in define_log_methods'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:435:in `_meta_eval'
/srv/worker_staging/shared/bundle/ruby/1.9.1/gems/logging-1.7.2/lib/logging/logger.rb:257:in `level'

-- C level backtrace information -------------------------------------------
SEGV received in SEGV handler
Aborted

Could this be fault of perftools.rb gem? Or did it just make hidden problems visible?

JRuby not able to read nil values from Zookeeper

When calling #get on a path that has a nil value results in the following exception in JRuby only:

TypeError: wrong argument type NilClass (expected byte[])
org/jruby/javasupport/JavaArrayUtilities.java:79:in bytes_to_ruby_string' org/jruby/javasupport/JavaArrayUtilities.java:57:inbytes_to_ruby_string'
org/jruby/java/addons/StringJavaAddons.java:16:in from_java_bytes' /Users/rmorrison/.rvm/gems/jruby-1.7.4@ruby_skynet/gems/zookeeper-1.4.4-java/java/java_base.rb:286:inget'
/Users/rmorrison/.rvm/gems/jruby-1.7.4@ruby_skynet/gems/zookeeper-1.4.4-java/java/java_base.rb:446:in handle_keeper_exception' /Users/rmorrison/.rvm/gems/jruby-1.7.4@ruby_skynet/gems/zookeeper-1.4.4-java/java/java_base.rb:278:inget'
/Users/rmorrison/.rvm/gems/jruby-1.7.4@ruby_skynet/gems/zookeeper-1.4.4-java/lib/zookeeper/client_methods.rb:40:in `get'

The same code works correctly on Ruby V2.0.0 and returns the nil value.

Found cause and will submit a pull request for it.

Failure to build on powerpc64le

Hi,

When I attempt to build on powerpc64le, I hit the following problem:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking build system type... ./config.guess: unable to guess system type

This script, last modified 2005-07-08, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub

If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <[email protected]> in order to provide the needed
information to handle your system.

config.guess timestamp = 2005-07-08

uname -m = ppc64le
uname -r = 4.2.0-30-generic
uname -s = Linux
uname -v = #35-Ubuntu SMP Fri Feb 19 13:50:54 UTC 2016

/usr/bin/uname -p = 
/bin/uname -X     = 

hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = 
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 

UNAME_MACHINE = ppc64le
UNAME_RELEASE = 4.2.0-30-generic
UNAME_SYSTEM  = Linux
UNAME_VERSION = #35-Ubuntu SMP Fri Feb 19 13:50:54 UTC 2016
configure: error: cannot guess build type; you must specify one
*** extconf.rb failed ***

It should be reasonably easy to fix this by updating your config.sub and config.guess files to the latest from autoconf/automake. Thanks in advance :)

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.