lib/redis_failover/util.rb in redis_failover-0.9.7.2 vs lib/redis_failover/util.rb in redis_failover-1.0.0
- old
+ new
@@ -49,24 +49,32 @@
# Unsupported Redis operations. These don't make sense in a client
# that abstracts the master/slave servers.
UNSUPPORTED_OPS = Set[:select, :dbsize].freeze
- # Default node in ZK that contains the current list of available redis nodes.
- DEFAULT_ZNODE_PATH = '/redis_failover_nodes'.freeze
+ # Default root node in ZK used for redis_failover.
+ DEFAULT_ROOT_ZNODE_PATH = '/redis_failover'.freeze
# Connectivity errors that the redis (<3.x) client raises.
REDIS_ERRORS = Errno.constants.map { |c| Errno.const_get(c) }
# Connectivity errors that the redis (>3.x) client raises.
REDIS_ERRORS << Redis::BaseError if Redis.const_defined?('BaseError')
REDIS_ERRORS.freeze
+ # ZK Errors
+ ZK_ERRORS = [
+ ZK::Exceptions::LockAssertionFailedError,
+ ZK::Exceptions::InterruptedSession,
+ ZK::Exceptions::Retryable,
+ Zookeeper::Exceptions::ContinuationTimeoutError
+ ].freeze
+
# Full set of errors related to connectivity.
CONNECTIVITY_ERRORS = [
RedisFailover::Error,
- ZK::Exceptions::InterruptedSession,
- REDIS_ERRORS
+ REDIS_ERRORS,
+ ZK_ERRORS
].flatten.freeze
# Symbolizes the keys of the specified hash.
#
# @param [Hash] hash a hash for which keys should be symbolized