Closed
Description
Version: 5.0.1
Platform: Python 3.8.18 on Ubuntu 20.04
Description: Backtrace to stderr on process exit due to redis.client.Redis.__del__()
Here is the trace:
Exception ignored in: <function Redis.__del__ at 0x7fcf29e50ca0>
Traceback (most recent call last):
File "/venv/lib/python3.8/site-packages/redis/client.py", line 491, in __del__
File "/venv/lib/python3.8/site-packages/redis/client.py", line 506, in close
File "/venv/lib/python3.8/site-packages/redis/connection.py", line 1155, in disconnect
File "/venv/lib/python3.8/site-packages/redis/connection.py", line 1062, in _checkpid
AttributeError: 'NoneType' object has no attribute 'getpid'
Occurs due to unloaded globals being referenced in methods called in destructors on process exit. See warning in Python docs here
This can be fixed in a couple of ways:
- Add an exception handler to
redis.client.Redis.__del__()
as it appears has been done in many other destructors (Line 226 in d3a3ada
- Add references to required globals to the
redis.connection.ConnectionPool
class and call via the references. The globals that require references in areos.getpid
andchain
(fromitertools
) afaict.
NOTE: It is quite hard to come up with a small piece of code to reproduce this issue as it is caused by a race in the unload order at exit. I'll try to come up with something reliable if req'd.
NOTE: The issue is triggered by
Line 506 in d3a3ada
Metadata
Metadata
Assignees
Labels
No labels