aio-libs-abandoned/aioredis-py

aioredis: await wasn't used with future

tufbel opened this issue · 0 comments

Describe the bug

I used APScheduler to add two jobs that execute once per second, both using sentinel to write to Redis.
But it takes about 4-5 minutes to throw two errors.

To Reproduce

I used APScheduler to add two jobs that execute once per second, both using sentinel to write to Redis.

Expected behavior

The program throws an error about every 4-5 minutes, and I don't want it.

Logs/tracebacks

Exception ignored in: <coroutine object Task.__write at 0x000002877B398640>
Traceback (most recent call last):
  File "D:\Dev\MyProject\WorkProjects\NCC\src\signalling_manager\forward_tasks.py", line 488, in __write_timeslot_plan
    await redis_client.eval(
  File "D:\Dev\Miniconda3\envs\NCC\lib\site-packages\aioredis\client.py", line 1085, in execute_command
    return await self.parse_response(conn, command_name, **options)
  File "D:\Dev\Miniconda3\envs\NCC\lib\site-packages\aioredis\client.py", line 1101, in parse_response
    response = await connection.read_response()
  File "D:\Dev\Miniconda3\envs\NCC\lib\site-packages\aioredis\sentinel.py", line 65, in read_response
    return await super().read_response()
RuntimeError: coroutine ignored GeneratorExit
future: <Task finished name='Task-222514' coro=<Connection.disconnect() done, defined at D:\Dev\Miniconda3\envs\NCC\lib\site-packages\aioredis\connection.py:794> exception=RuntimeError("await wasn't used with future")>
Traceback (most recent call last):
  File "D:\Dev\Miniconda3\envs\NCC\lib\site-packages\aioredis\connection.py", line 806, in disconnect
    await self._writer.wait_closed()  # type: ignore[union-attr]
          │    └ <member '_writer' of 'Connection' objects><unprintable SentinelManagedConnection object>
  File "D:\Dev\Miniconda3\envs\NCC\lib\asyncio\streams.py", line 359, in wait_closed
    await self._protocol._get_close_waiter(self)
          │    │         │                 └ <StreamWriter transport=<_ProactorSocketTransport closing fd=1992> reader=<StreamReader transport=<_ProactorSocketTransport c...
          │    │         └ <function StreamReaderProtocol._get_close_waiter at 0x0000028777F52280>
          │    └ <asyncio.streams.StreamReaderProtocol object at 0x000002877AC413D0><StreamWriter transport=<_ProactorSocketTransport closing fd=1992> reader=<StreamReader transport=<_ProactorSocketTransport c...
RuntimeError: await wasn't used with future

Python Version

3.9.12

aioredis Version

aioredis           2.0.1

Additional context

Both Redis and Sentinel are deployed through Kubernetes.

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct