redis / redis-py

Redis Python client
MIT License
12.71k stars 2.53k forks source link

Type Error Duing redis cluster rebalance operation. #3011

Open tbbream opened 1 year ago

tbbream commented 1 year ago

Version: What redis-py and what redis version is the issue happening on? 4.5.3

But this error appears to exist on all versions of the client library

Platform: What platform / version? (For example Python 3.5.1 on Windows 7 / Ubuntu 15.10 / Azure) Python 3.10 on ubuntu docker image

Description: Description of your issue, stack traces from errors and code that reproduces the issue

During our cluster rebalancing, calls made using the SET command with the GET option result in failures. The redis cluster gets an asking command, but forwards the original options to the parsing, which result in a type error.

TypeError: bool_ok() got an unexpected keyword argument 'get'
  File "root/event_processing/unique_service/server/server/interceptors.py", line 51, in intercept
    result = method(request_or_iterator, context)
  File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper
    return func(*args, **kwargs)
  File "root/event_processing/unique_service/server/server/routers.py", line 68, in RecordBatch
    responses = self.unique_service.record_or_get_event_batch(unique_service_requests)
  File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper
    return func(*args, **kwargs)
  File "root/event_processing/unique_service/server/services/unique.py", line 312, in record_or_get_event_batch
    active_results = self._active_record_batch(active_requests)
  File "root/event_processing/unique_service/server/services/unique.py", line 158, in _active_record_batch
    response_batch = self.active.record_or_get_event_batch(
  File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper
    return func(*args, **kwargs)
  File "root/event_processing/unique_service/server/repository/active.py", line 203, in record_or_get_event_batch
    return [self.record_or_get_event(request) for request in request_batch]
  File "root/event_processing/unique_service/server/repository/active.py", line 203, in <listcomp>
    return [self.record_or_get_event(request) for request in request_batch]
  File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper
    return func(*args, **kwargs)
  File "root/event_processing/unique_service/server/repository/active.py", line 252, in record_or_get_event
    result = self._get_redis_cluster().set(
  File "redis/commands/core.py", line 2302, in set
    return self.execute_command("SET", *pieces, **options)
  File "/root/.pex/venvs/88a5344e0040931bbcf0ac82f021c059eb108950/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/lib/python3.10/site-packages/pex-ns-pkgs/14/opentelemetry/instrumentation/redis/__init__.py", line 162, in _traced_execute_command
    response = func(*args, **kwargs)
  File "redis/cluster.py", line 1074, in execute_command
    raise e
  File "redis/cluster.py", line 1060, in execute_command
    res[node.name] = self._execute_command(node, *args, **kwargs)
  File "root/event_processing/unique_service/server/tracing_redis_cluster.py", line 65, in _traced_execute_command
    response = func(*args, **kwargs)
  File "redis/cluster.py", line 1169, in _execute_command
    raise e
  File "redis/cluster.py", line 1106, in _execute_command
    redis_node.parse_response(connection, "ASKING", **kwargs)
  File "redis/client.py", line 1285, in parse_response
    return self.response_callbacks[command_name](response, **options)
tbbream commented 1 year ago

Solution for the 5.0.0 series: https://github.com/redis/redis-py/pull/3012

tbbream commented 1 year ago

Solution for the 4.6.0 series: https://github.com/redis/redis-py/pull/3013