Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove aredis #627

Open
2 tasks done
dakotahorstman opened this issue May 8, 2024 · 0 comments
Open
2 tasks done

Remove aredis #627

dakotahorstman opened this issue May 8, 2024 · 0 comments

Comments

@dakotahorstman
Copy link

Checklist

  • I have included information about relevant versions
  • I have verified that the issue persists when using the master branch of Faust.

Steps to reproduce

Configure App with a redis cache and a TypeError will be raised. This is due to python/cpython#86558 where the loop parameter was removed from asyncio.open_connection in Python 3.10+. aredis was a port of redis-py for async functionality; however, redis-py now includes that functionality natively.

Additionally, aredis is unmaintained and has not been updated in years.

Expected behavior

No exception.

Actual behavior

TypeError was raised.

Full traceback

Traceback (most recent call last):
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 415, in connect
    await self._connect()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 594, in _connect
    reader, writer = await exec_with_timeout(
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 39, in exec_with_timeout
    return await asyncio.wait_for(coroutine, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/streams.py", line 48, in open_connection
    transport, _ = await loop.create_connection(
                         ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'loop'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/client.py", line 155, in execute_command
    await connection.send_command(*args)
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 486, in send_command
    await self.connect()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 417, in connect
    raise ConnectionError()
aredis.exceptions.ConnectionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 415, in connect
    await self._connect()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 594, in _connect
    reader, writer = await exec_with_timeout(
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 39, in exec_with_timeout
    return await asyncio.wait_for(coroutine, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/streams.py", line 48, in open_connection
    transport, _ = await loop.create_connection(
                         ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'loop'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/worker.py", line 277, in execute_from_commandline
    self.loop.run_until_complete(self._starting_fut)
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 830, in start
    await self._default_start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 837, in _default_start
    await self._actually_start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 861, in _actually_start
    await child.maybe_start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 889, in maybe_start
    await self.start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 830, in start
    await self._default_start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 837, in _default_start
    await self._actually_start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 861, in _actually_start
    await child.maybe_start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 889, in maybe_start
    await self.start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 830, in start
    await self._default_start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 837, in _default_start
    await self._actually_start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/mode/services.py", line 854, in _actually_start
    await self.on_start()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/faust/web/cache/backends/redis.py", line 115, in on_start
    await self.connect()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/faust/web/cache/backends/redis.py", line 121, in connect
    await self.client.ping()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/commands/connection.py", line 20, in ping
    return await self.execute_command('PING')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/client.py", line 165, in execute_command
    await connection.send_command(*args)
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 486, in send_command
    await self.connect()
  File "/home/dev-user/.cache/pypoetry/virtualenvs/worker-9TtSrW0h-py3.12/lib/python3.12/site-packages/aredis/connection.py", line 417, in connect
    raise ConnectionError()
aredis.exceptions.ConnectionError

The aredis code causing the issue:

async def _connect(self):
    reader, writer = await exec_with_timeout(
        asyncio.open_connection(host=self.host,
                                port=self.port,
                                ssl=self.ssl_context,
                                loop=self.loop),  # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        self._connect_timeout,
        loop=self.loop
    )

Versions

  • Python version: 3.12.3
  • Faust version: 0.11.0
  • Operating system: Ubuntu 22.04 (docker)
  • Kafka version: latest
  • RocksDB version (if applicable): NA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant