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

Remove references to disposed SQLAlchemy engines from instrumentation singleton #3053

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rbagd
Copy link
Contributor

@rbagd rbagd commented Nov 27, 2024

EngineTracer singleton class in SQLAlchemy instrumentations keeps weak references to a traced SQLAlchemy engine forever which can cause a noticeable memory leak if engines are constantly being created.

Description

Previously raised issue #1761 regarding a memory leak in SQLAlchemy instrumentation was partially fixed by yours truly in PR#1771, but the fix appears to have been incomplete. This PR should completely fix #1761.

Fixes #1761

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Additional unit test to ensure objects are cleaned up

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

EngineTracer in SQLAlchemy keeps weak references to a traced engine forever which
can cause a noticeable memory leak if engines are constantly getting creating.
@rbagd rbagd requested a review from a team as a code owner November 27, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sqlalchemy memory leak with Engine cleanup introduced in 0.37b0
3 participants