-
Notifications
You must be signed in to change notification settings - Fork 516
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
fix: add a close statement to ensure session is closed on error #1777
fix: add a close statement to ensure session is closed on error #1777
Conversation
Signed-off-by: Kim Ebert <[email protected]>
One of the tests is failing:
|
Are you able to test the changes in this PR? #1692 The store should still be closed in the case of an exception when it is garbage collected, however there might be an existing reference preventing that from happening. The garbage collector should still handle circular references so I'm not sure how it would accumulate many of these, though. Does the error still happen with Sqlite as a backend? There was a potentially related fix in sqlx, but it doesn't look like it's being backported to a 0.5.x release which is unfortunate. launchbadge/sqlx#1799 |
@andrewwhitehead I tested against #1692, and that doesn't solve the problem. It appears the issue may be related to the Python garbage collector not closing the session quickly enough, leaving connection pool objects borrowed from the pool. To keep the pool operating efficiently, we should probably close the connection as quickly as possible. |
Signed-off-by: Kim Ebert <[email protected]>
@ianco fixed the tests. |
@reflectivedevelopment if you sync up wth the main branch then we can merge |
Askar, on error, would end up not returning connections to the connection pool because aca-py left the connections open.