Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Separate state mutex #55

Merged
merged 5 commits into from Dec 6, 2013

Conversation

Projects
None yet
2 participants
Member

eric commented Dec 2, 2013

I've observed deadlocks related to forking.

Here's an example:

#<Thread:0xb166e48 sleep> alive=true priority=0
    bundle/ruby/1.8/gems/zookeeper-1.4.7/lib/zookeeper/common/queue_with_pipe.rb:59:in `pop'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/lib/zookeeper/common.rb:56:in `get_next_event'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/lib/zookeeper/common.rb:94:in `dispatch_thread_body'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/lib/zookeeper/common.rb:91:in `to_proc'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/lib/zookeeper/common.rb:20:in `initialize'


#<Thread:0xb1669e8 sleep> alive=true priority=0
    /usr/lib/ruby/1.8/monitor.rb:285:in `mon_acquire'
    /usr/lib/ruby/1.8/monitor.rb:214:in `mon_enter'
    /usr/lib/ruby/1.8/monitor.rb:240:in `synchronize'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/c_zookeeper.rb:333:in `iterate_event_delivery'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/c_zookeeper.rb:274:in `event_thread_body'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/c_zookeeper.rb:261:in `to_proc'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/c_zookeeper.rb:246:in `initialize'


#<Thread:0x30de4d8 run> [main] [current] alive=true priority=0
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/c_zookeeper.rb:237:in `call'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/c_zookeeper.rb:237:in `join'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/c_zookeeper.rb:237:in `stop_event_thread'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/c_zookeeper.rb:160:in `pause_before_fork_in_parent'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/c_zookeeper.rb:160:in `pause_before_fork_in_parent'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/zookeeper_base.rb:202:in `pause_before_fork_in_parent'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/ext/zookeeper_base.rb:196:in `pause_before_fork_in_parent'
    bundle/ruby/1.8/gems/zookeeper-1.4.7/lib/zookeeper/client_methods.rb:226:in `pause_before_fork_in_parent'
    bundle/ruby/1.8/gems/redis-3.0.4/lib/redis/connection/ruby.rb:49:in `to_proc'
    bundle/ruby/1.8/bundler/gems/zk-52329d54572e/lib/zk/client/threaded.rb:292:in `each'
    bundle/ruby/1.8/bundler/gems/zk-52329d54572e/lib/zk/client/threaded.rb:292:in `pause_before_fork_in_parent'
    bundle/ruby/1.8/bundler/gems/zk-52329d54572e/lib/zk/subscription.rb:50:in `call'
    bundle/ruby/1.8/bundler/gems/zk-52329d54572e/lib/zk/subscription.rb:50:in `call'
    bundle/ruby/1.8/bundler/gems/zk-52329d54572e/lib/zk/fork_hook.rb:62:in `safe_call'
    bundle/ruby/1.8/bundler/gems/zk-52329d54572e/lib/zk/fork_hook.rb:20:in `fire_prepare_hooks!'
    bundle/ruby/1.8/bundler/gems/zk-52329d54572e/lib/zk/install_fork_hooks.rb:14:in `fork'
    bundle/ruby/1.8/gems/resque-1.23.0/lib/resque/worker.rb:259:in `fork'
    bundle/ruby/1.8/gems/resque-1.23.0/lib/resque/worker.rb:141:in `work'
    bundle/ruby/1.8/gems/resque-1.23.0/lib/resque/worker.rb:133:in `loop'
    bundle/ruby/1.8/gems/resque-1.23.0/lib/resque/worker.rb:133:in `work'
    bundle/ruby/1.8/gems/resque-1.23.0/lib/resque/tasks.rb:36

@eric eric added a commit that referenced this pull request Dec 6, 2013

@eric eric Merge pull request #55 from zk-ruby/separate-state-mutex
Separate state mutex
372fc1f

@eric eric merged commit 372fc1f into master Dec 6, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment