Skip to content

Commit

Permalink
Delete special handling of blocking command timeouts (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal authored Dec 14, 2023
2 parents 11d4b68 + 940be0c commit 7cafb29
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
3 changes: 0 additions & 3 deletions lib/redis_client/cluster/router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class RedisClient
class Cluster
class Router
ZERO_CURSOR_FOR_SCAN = '0'
METHODS_FOR_BLOCKING_CMD = %i[blocking_call_v blocking_call].freeze
TSF = ->(f, x) { f.nil? ? x : f.call(x) }.curry

def initialize(config, concurrent_worker, pool: nil, **kwargs)
Expand Down Expand Up @@ -102,8 +101,6 @@ def try_send(node, method, command, args, retry_count: 3, &block) # rubocop:disa
end
raise
rescue ::RedisClient::ConnectionError => e
raise if METHODS_FOR_BLOCKING_CMD.include?(method) && e.is_a?(RedisClient::ReadTimeoutError)

update_cluster_info!

raise if retry_count <= 0
Expand Down
19 changes: 0 additions & 19 deletions test/redis_client/test_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,25 +461,6 @@ def test_compatibility_with_redis_gem
assert_raises(NoMethodError) { @client.densaugeo('1m') }
end

def test_circuit_breakers
cli = ::RedisClient.cluster(
nodes: TEST_NODE_URIS,
fixed_hostname: TEST_FIXED_HOSTNAME,
**TEST_GENERIC_OPTIONS.merge(
circuit_breaker: {
error_threshold: 1,
error_timeout: 60,
success_threshold: 10
}
)
).new_client

assert_raises(::RedisClient::ReadTimeoutError) { cli.blocking_call(0.1, 'BRPOP', 'foo', 0) }
assert_raises(::RedisClient::CircuitBreaker::OpenCircuitError) { cli.blocking_call(0.1, 'BRPOP', 'foo', 0) }

cli&.close
end

private

def wait_for_replication
Expand Down

0 comments on commit 7cafb29

Please sign in to comment.