Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seemingly unconfigurable receive timeout #87

Closed
wwboynton opened this issue Jun 11, 2015 · 4 comments
Closed

Seemingly unconfigurable receive timeout #87

wwboynton opened this issue Jun 11, 2015 · 4 comments

Comments

@wwboynton
Copy link

Hello!

I've been experiencing a problem with timeouts in the zk gem. When I make a .children call on a very large zk system, I time out after exactly ten seconds.

I'm aware (now, anyway) that the connection timeout established in ZK::Client::Threaded is not the same timeout I'm looking for. I also noted this bit on line 63 of threaded.rb:

  # @note The `:timeout` argument here is *not* the session_timeout for the
  #   connection. rather it is the amount of time we wait for the connection
  #   to be established. The session timeout exchanged with the server is 
  #   set to 10s by default in the C implemenation, and as of version 0.8.0 
  #   of slyphon-zookeeper has yet to be exposed as an option. That feature
  #   is planned. 

However, I'd like to assume that the session timeout is not what I'm looking for either.

Is the timeout I need to prevent the following trace exposed anywhere?

#<ZK::Exceptions::OperationTimeOut: inputs: {:path=>"/path/to/some/node"}>
inputs: {:path=>"/path/to/some/node"}
/Users/wwboynton/.rvm/gems/ruby-1.9.3-p392/gems/zk-1.8.0/lib/zk/client/base.rb:1068:in `check_rc'
/Users/wwboynton/.rvm/gems/ruby-1.9.3-p392/gems/zk-1.8.0/lib/zk/client/base.rb:1057:in `call_and_check_rc'
/Users/wwboynton/.rvm/gems/ruby-1.9.3-p392/gems/zk-1.8.0/lib/zk/client/threaded.rb:581:in `call_and_check_rc'
/Users/wwboynton/.rvm/gems/ruby-1.9.3-p392/gems/zk-1.8.0/lib/zk/client/base.rb:717:in `block in children'
/Users/wwboynton/.rvm/gems/ruby-1.9.3-p392/gems/zk-1.8.0/lib/zk/event_handler.rb:282:in `setup_watcher!'
/Users/wwboynton/.rvm/gems/ruby-1.9.3-p392/gems/zk-1.8.0/lib/zk/client/base.rb:1100:in `setup_watcher!'
/Users/wwboynton/.rvm/gems/ruby-1.9.3-p392/gems/zk-1.8.0/lib/zk/client/base.rb:716:in `children'
zk.children call results in ^

Thank you!

@slyphon
Copy link
Contributor

slyphon commented Jun 15, 2015

So, fair warning, it's been a long time since I've really dealt with this code. You may be running into the zookeeper gem's DEFAULT_RECEIVE_TIMEOUT_MSEC which is 10s. This was based on the default cluster timeout of 20s (at the time of writing).

You should try creating your ZK instance like:

zk = ZK.new(:receive_timeout_msec => 30_000) # 30s

and see if that helps

@wwboynton
Copy link
Author

Thanks for your suggestion! I'll absolutely give that a shot when I get into work and I'll report back on it.

@ankane
Copy link

ankane commented Jul 23, 2018

Just fyi, I tried the receive_timeout_msec setting for this guide with the latest version (1.9.6) and it didn't seem to have an impact (got Zookeeper::Exceptions::ContinuationTimeoutError after 30 seconds)

@wwboynton
Copy link
Author

My recollection was that this trick worked at the time. That said, this library hasn't been given a significant update in years, and doesn't even really support ruby 2.0. The potential for bitrot is tremendous, and you should probably find another library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants