redis / redis-py

Redis Python client
MIT License
12.4k stars 2.48k forks source link

not closing async generators causes issues downstream #3273

Open agnesnatasya opened 3 weeks ago

agnesnatasya commented 3 weeks ago

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

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

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

Some of the async generators, especially the rotate_slaves in asyncio/sentinel.py are not closed immediately using aclosing,. This is fine most of the time but it causes a PytestUnraisableExceptionWarning in some pytest runs downstream. This can be easily fixed by adding an aclosing context manager but this is only supported after python 3.10