-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pool.query(new QueryStream(...)) unexpected behaviour #2013
Comments
yeah that sounds like a problem - I'll definitely look at this. For now I think a workaround you can do is
Sorry for the hassle - i'll get this fixed |
that's what I did (wrapped in try-finally) |
Just running into this now with [email protected]. and [email protected], is the workaround above still the best option? |
I am wondering if this is the cause of the issue that I am seeing on [email protected]. I have a codebase that appears to run OK but the issue appears in functional testing. Our unit tests actually run against a database and we use pool.query to run queries. We have a lot of unit tests and about 3/4 of the way through we see :
Is there anything that I can add to our function to ensure it is releasing things correctly (if this is in fact the issue)? Many thanks. I have tried replacing pool.query with getting a client and then releasing it but this doesn't resolve the issue |
I've submitted a PR that fixes this 👀 |
Run into this today as well, it tooks me several hours to figure out why (and yet I know well this library !) It would be great to finalize the PR |
Hi,
if I use the
query
method on pg.Pool with a query object that implementssumbit
(i.e. pg-query-stream or pg-cursor) like this:the returned promise never resolves and the pool never releases the used client
I could ignore the return value and continue with the result, e.g.
but the client leak is a problem
furthermore, the typescript definition is plain wrong:
The text was updated successfully, but these errors were encountered: