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 creating ref cycles #408

Merged
merged 10 commits into from
Jan 15, 2024
Merged

Avoid creating ref cycles #408

merged 10 commits into from
Jan 15, 2024

Commits on Sep 23, 2023

  1. Avoid creating ref cycles

    By storing previously raised exceptions inside a local, this code created ref cycles that kept all locals in all calling stack frames alive.
    
    This is because exceptions hold references to their tracebacks, which hold references to the relevant frames, which holds a reference to the local errors dict that holds references to the exceptions. See https://peps.python.org/pep-0344/#open-issue-garbage-collection and https://peps.python.org/pep-3110/#rationale
    
    This breaks the cycle by deleting the local when we raise, so frames are destroyed by the normal reference counting mechanism.
    
    This fixes some resource exhaustion issues I encountered at work.
    hauntsaninja authored Sep 23, 2023
    Configuration menu
    Copy the full SHA
    f165e56 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8b5d2c6 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2024

  1. code review

    hauntsaninja committed Jan 14, 2024
    Configuration menu
    Copy the full SHA
    7577df5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aa32213 View commit details
    Browse the repository at this point in the history
  3. .

    hauntsaninja committed Jan 14, 2024
    Configuration menu
    Copy the full SHA
    3e31b88 View commit details
    Browse the repository at this point in the history
  4. comment

    hauntsaninja committed Jan 14, 2024
    Configuration menu
    Copy the full SHA
    fdb173e View commit details
    Browse the repository at this point in the history
  5. pypy

    hauntsaninja committed Jan 14, 2024
    Configuration menu
    Copy the full SHA
    cf38460 View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2024

  1. changelog and fix

    hauntsaninja committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    4802b3a View commit details
    Browse the repository at this point in the history
  2. Update versionhistory.rst

    agronholm authored Jan 15, 2024
    Configuration menu
    Copy the full SHA
    8afdea8 View commit details
    Browse the repository at this point in the history
  3. remove link

    hauntsaninja committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    17ffe9c View commit details
    Browse the repository at this point in the history