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

Avoid stacktrace on process exit in Client.__del__() #3397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 1, 2024

  1. Avoid stacktrace on process exit in Client.__del__()

    Client.close() may call ConnectionPool.release() or
    ConnectionPool.disconnect(); both methods may end up calling
    os.getpid() (through ConnectionPool._checkpid() or threading.Lock()
    (through ConnectionPool.reset()). As mentioned in the Python
    documentation [1], at interpreter shutdown, module globals (in this
    case, the os and threading module references) may be deleted or set to
    None before __del__() methods are called. This causes an
    AttributeError to be raised when trying to run e.g. os.getpid(); while
    the error is ignored by the interpreter, the traceback is still
    printed out to stderr.
    
    Closes redis#3014
    
    [1] https://docs.python.org/3/reference/datamodel.html#object.__del__
    noirbee committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    ae5b957 View commit details
    Browse the repository at this point in the history