jamesls/fakeredis

redis 3.3.0 adds `Connection.health_check_interval` attribute

isms opened this issue · 3 comments

isms commented

An attribute added to redis.connection.Connection last week in 3.3.0 causes an error with current FakeConnection since this attr is now expected.

Here is an example traceback from rq up through redis (with redis==3.3.0 and fakeredis==1.0.3):

Traceback (most recent call last):
 ... <snip project specific traceback lines>
  File "/path/to/virtualenv/lib/python3.6/site-packages/rq/queue.py", line 336, in enqueue
    at_front=at_front, meta=meta
  File "/path/to/virtualenv/lib/python3.6/site-packages/django_rq/queues.py", line 70, in enqueue_call
    return self.original_enqueue_call(*args, **kwargs)
  File "/path/to/virtualenv/lib/python3.6/site-packages/django_rq/queues.py", line 66, in original_enqueue_call
    return super(DjangoRQ, self).enqueue_call(*args, **kwargs)
  File "/path/to/virtualenv/lib/python3.6/site-packages/rq/queue.py", line 286, in enqueue_call
    job = self.enqueue_job(job, at_front=at_front)
  File "/path/to/virtualenv/lib/python3.6/site-packages/rq/queue.py", line 362, in enqueue_job
    pipe.execute()
  File "/path/to/virtualenv/lib/python3.6/site-packages/redis/client.py", line 3677, in execute
    return execute(conn, stack, raise_on_error)
  File "/path/to/virtualenv/lib/python3.6/site-packages/redis/client.py", line 3544, in _execute_transaction
    connection.send_packed_command(all_cmds)
  File "/path/to/virtualenv/lib/python3.6/site-packages/redis/connection.py", line 632, in send_packed_command
    self.check_health()
  File "/path/to/virtualenv/lib/python3.6/site-packages/redis/connection.py", line 613, in check_health
    if self.health_check_interval and time() > self.next_health_check:
AttributeError: 'FakeConnection' object has no attribute 'health_check_interval'

Thanks for the report. I'm going on holiday shortly so I won't be able to deal with this for a few weeks. I'll try to remember to look at it when I get back. If you haven't heard anything by late August feel free to ping me again.

Hi @bmerry, do you plan to release this fix soon?

I'm on holiday at the moment, but I should be able to get a release out later this week.