make sure to use the old 5 second timeout form redis.rb < 5.0
MODIFY
lib/beetle/configuration.rb
lib/beetle/configuration.rb
@@ -33,6 +33,12 @@ module Beetle
attr_accessor :redis_servers
# redis database number to use for the message deduplication store (defaults to <tt>4</tt>)
attr_accessor :redis_db
+ # redis connect timeout. defaults to 5 seconds.
+ attr_accessor :redis_connect_timeout
+ # redis read timeout. defaults to 5 seconds.
+ attr_accessor :redis_read_timeout
+ # redis write timeout. defaults to 5 seconds.
+ attr_accessor :redis_write_timeout
# how long we should repeatedly retry a redis operation before giving up, with a one
# second sleep between retries (defaults to <tt>180.seconds</tt>). this value needs to be
@@ -157,6 +163,9 @@ module Beetle
self.redis_server = "localhost:6379"
self.redis_servers = ""
self.redis_db = 4
+ self.redis_connect_timeout = 5.0
+ self.redis_read_timeout = 5.0
+ self.redis_write_timeout = 5.0
self.redis_failover_timeout = 180.seconds
self.redis_status_key_expiry_interval = 0.seconds
self.redis_failover_client_heartbeat_interval = 10.seconds
@@ -217,6 +226,17 @@ module Beetle
end
end
+ # redis optins to be passed to Redis.new
+ def redis_options
+ {
+ db: redis_db,
+ connect_timeout: redis_connect_timeout,
+ read_timeout: redis_read_timeout,
+ write_timeout: redis_write_timeout,
+ logger: redis_logger,
+ }
+ end
+
private
def load_config
raw = ERB.new(IO.read(config_file)).result

MODIFY
lib/beetle/deduplication_store.rb
lib/beetle/deduplication_store.rb
@@ -150,7 +150,7 @@ module Beetle
# set current redis master instance (as specified in the Beetle::Configuration)
def redis_master_from_server_string
- @current_master ||= Redis.from_server_string(@config.redis_server, :db => @config.redis_db, :logger => @config.redis_logger)
+ @current_master ||= Redis.from_server_string(@config.redis_server, @config.redis_options)
end
# set current redis master from master file
@@ -168,7 +168,7 @@ module Beetle
def set_current_redis_master_from_master_file
@last_time_master_file_changed = File.mtime(@config.redis_server)
server_string = extract_redis_master(read_master_file)
- @current_master = !server_string.blank? ? Redis.from_server_string(server_string, :db => @config.redis_db, :logger => @config.redis_logger) : nil
+ @current_master = !server_string.blank? ? Redis.from_server_string(server_string, @config.redis_options ) : nil
end
# extract redis master from file content and return the server for our system

make sure to use the old 5 second timeout form redis.rb < 5.0