From eb6e4c8d512c6451d2430744322014439e8a0df8 Mon Sep 17 00:00:00 2001 From: Peter Lithammer Date: Fri, 22 Feb 2019 07:09:39 +0100 Subject: [PATCH] Revert #954 and update redis-py to at least 3.2.0 (#1011) This reverts #954, and bumps the required redis-py dependency to 3.2.0 to include this fix: https://github.com/andymccurdy/redis-py/commit/4e1e74809235edc19e03edb79c97c80a3e4e9eca Fixes #1006 --- kombu/transport/redis.py | 20 +++----------------- requirements/extras/redis.txt | 2 +- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/kombu/transport/redis.py b/kombu/transport/redis.py index 6571e860..93a21358 100644 --- a/kombu/transport/redis.py +++ b/kombu/transport/redis.py @@ -931,22 +931,8 @@ class Channel(virtual.Channel): if asynchronous: class Connection(connection_cls): def disconnect(self): - # NOTE: see celery issue #3898 - # redis-py Connection shutdown()s the socket - # which causes all copies of file descriptor - # to become unusable, however close() only - # affect process-local copies of fds. - # So we just override Connection's disconnect method. - self._parser.on_disconnect() + super(Connection, self).disconnect() channel._on_connection_disconnect(self) - if self._sock is None: - return - try: - # self._sock.shutdown(socket.SHUT_RDWR) - self._sock.close() - except socket.error: - pass - self._sock = None connection_cls = Connection connparams['connection_class'] = connection_cls @@ -964,9 +950,9 @@ class Channel(virtual.Channel): return redis.ConnectionPool(**params) def _get_client(self): - if redis.VERSION < (2, 10, 5): + if redis.VERSION < (3, 2, 0): raise VersionMismatch( - 'Redis transport requires redis-py versions 2.10.5 or later. ' + 'Redis transport requires redis-py versions 3.2.0 or later. ' 'You have {0.__version__}'.format(redis)) return redis.StrictRedis diff --git a/requirements/extras/redis.txt b/requirements/extras/redis.txt index 69fff9ad..b0d3f0fb 100644 --- a/requirements/extras/redis.txt +++ b/requirements/extras/redis.txt @@ -1 +1 @@ -redis>=2.10.5 +redis>=3.2.0