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

[WIP] Close session after operation #181

Closed
lchen-2101 opened this issue Apr 25, 2024 · 0 comments · Fixed by #174
Closed

[WIP] Close session after operation #181

lchen-2101 opened this issue Apr 25, 2024 · 0 comments · Fixed by #174
Assignees
Labels
bug Something isn't working

Comments

@lchen-2101
Copy link
Collaborator

make sure to close the db session when the session is manually created, and not coming from the request object (we automatically set a db_session in the request object which does a finally: close() at end of the generator

The garbage collector is trying to clean up non-checked-in connection <AdaptedConnection <asyncpg.connection.Connection object at 0x11b4dda90>>, which will be terminated.  Please ensure that SQLAlchemy pooled connections are returned to the pool explicitly, either by calling ``close()`` or by using appropriate context managers to manage their lifecycle.
sys:1: SAWarning: The garbage collector is trying to clean up non-checked-in connection <AdaptedConnection <asyncpg.connection.Connection object at 0x11b4dda90>>, which will be terminated.  Please ensure that SQLAlchemy pooled connections are returned to the pool explicitly, either by calling ``close()`` or by using appropriate context managers to manage their lifecycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants