mirror of
https://github.com/langchain-ai/langchain-postgres.git
synced 2026-07-16 01:33:18 -04:00
Engine object is not being properly disposed in PGVector #51
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ladi-pomsar on GitHub (Oct 14, 2024).
Hi everyone,
In #64 del method (lines 326-328) was removed from VectorStores.PGVector. While, after a bit of investigation, I believe this was a right decision, I would say it might need to be reintroduced. The way code currently is, the Engine object (stored in self._engine) doesn't dispose properly, upon deletion, if it is initialized from string by user through the connection parameter (as for lines 432 to 438).
I have faced "too many connections" error that seem to be fixed by disposing the engine with .dispose.