Comments (4)
(gdb) thread 3
[Switching to thread 3 (Thread 0x7ff90eea0700 (LWP 32434))]#0 0x00007ff91858f543 in poll () from /lib/libc.so.6
(gdb) bt
#0 0x00007ff91858f543 in poll () from /lib/libc.so.6
#1 0x00007ff9102f9ba5 in do_io (v=0xb51ec00) at src/mt_adaptor.c:299
#2 0x00007ff91829e9ca in start_thread () from /lib/libpthread.so.0
#3 0x00007ff91859bcdd in clone () from /lib/libc.so.6
#4 0x0000000000000000 in ?? ()
(gdb) thread 2
[Switching to thread 2 (Thread 0x7ff90f8a1700 (LWP 32435))]#0 0x00007ff9182a385c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
(gdb) bt
#0 0x00007ff9182a385c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1 0x00007ff9102f999b in do_completion (v=) at src/mt_adaptor.c:330
#2 0x00007ff91829e9ca in start_thread () from /lib/libpthread.so.0
#3 0x00007ff91859bcdd in clone () from /lib/libc.so.6
#4 0x0000000000000000 in ?? ()
(gdb) thread 1
(gdb) bt
#0 0x00007ff9182a003d in pthread_join () from /lib/libpthread.so.0
#1 0x00007ff9102f9868 in adaptor_finish (zh=0x78ea300) at src/mt_adaptor.c:211
#2 0x00007ff9102f2a9c in zookeeper_close (zh=0x78ea300) at src/zookeeper.c:2297
#3 0x00007ff9102e9d61 in destroy_zkrb_instance (ptr=0x30deb70) at zookeeper_c.c:48
#4 0x0000000000432563 in run_final (obj=181981800) at gc.c:2664
#5 0x000000000043258e in finalize_list (p=0xad8d268) at gc.c:1645
#6 0x0000000000432942 in rb_gc_finalize_deferred () at gc.c:2692
#7 0x0000000000420660 in rb_thread_schedule () at eval.c:11336
#8 0x0000000000421fe5 in eval_check_tick () at eval.c:5755
#9 0x000000000041b93c in rb_call0 (klass=13330720, recv=0, id=3031, oid=3031, argc=0, argv=0x7eb1, body=0xcb6678, flags=0) at eval.c:6010
#10 0x000000000041c8b3 in rb_call (klass=13330720, recv=0, mid=3031, argc=0, argv=0x0, scope=0, self=185131760) at eval.c:6308
#11 0x0000000000427bc8 in eval_call (self=185131760, node=0x2b3fae0) at eval.c:3381
#12 0x0000000000419d44 in rb_eval (self=185131760, node=0x2b3fab8) at eval.c:3910
#13 0x000000000041970c in rb_eval (self=185131760, node=0x2b3dee8) at eval.c:3858
#14 0x000000000041c5ab in rb_call0 (klass=45092760, recv=185131760, id=73289, oid=, argc=0, argv=0x7fff3828ba18, body=0x2b38d30, flags=942193176) at eval.c:6211
from zookeeper.
This specific snapshot is from zookeeper version 0.4.4, but after upgrading to the latest we still see the same behavior.
Of note, our "workaround" is to keep the connection object around so that GC doen't get to it.
from zookeeper.
Zookeeper had a lot of work done on it to make this as safe as possible in the MRI 1.8 world. In > 1.0, try this procedure:
z = Zookeeper.new("localhost:2181")
# in parent
z.pause_before_fork_in_parent
fork do
# in child
z.reopen
end
# in parent, after fork
z.resume_after_fork_in_parent
This takes care of stopping the event loop and making sure the main thread owns all the locks before forking, then re-opening the connection in the child, and re-starting the event loop in the parent. Getting fork() to work correctly is a huge pain with a multi-threaded lib like zookeeper. The above procedure should preserve in-flight state in the parent (callbacks, events, etc.) and reset state in the child (i.e. open a new connection, as sharing a session between parent and child wouldn't work).
from zookeeper.
in the ZK lib, I integrate with these two modules to handle this automatically: https://github.com/slyphon/zk/blob/master/lib/zk/fork_hook.rb and https://github.com/slyphon/zk/blob/master/lib/zk/install_fork_hooks.rb
from zookeeper.
Related Issues (20)
- Zookeeper fails to compile on Alpine >= 3.13 HOT 1
- Failure to build zookeeper gem's native extension on linux-aarch64 HOT 3
- Zookeeper Driver Update HOT 3
- Zookeeper installation failing since the latest update HOT 3
- Gem install fails for Ruby 3.2 in MacOS 12.6 HOT 4
- JRuby: LoadError: no such file to load -- log4j HOT 1
- Failure to install on OS X 10.10 Yosemite HOT 5
- Issue installing 1.4.6 on OS X 10.10 & ruby 2.1.2p95 HOT 2
- ArgumentError - too large fdsets: HOT 2
- install fails on 64-bit Linux HOT 4
- Is the log4j gem a hard requirement or does log4j just need to be on the classpath HOT 1
- Broken on ruby-2.2.0 because of deprecated rb_thread_select HOT 7
- Can't install with ruby 1.9.3 HOT 1
- Publish java version to rubygems HOT 2
- Failure to build on powerpc64le HOT 1
- Does we have a solution to build zookeeper on os x yosemite 10.10.5 HOT 5
- Compilation Error with GCC 8 HOT 14
- zookeeper zk doesn't support ttl container nodes
- Expose reconfig calls from the API
- New gem release? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zookeeper.