-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
pool.end() resolves before the last pool.query() #3461
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
Conversation
Because when you don't pass a callback to .end() it always returns a promise
Deploying node-postgres with Cloudflare Pages Cloudflare Pages
289273c
f087b5e
to
289273c
Compare
note: if we want to merge this, then i should update the docs for https://node-postgres.com/apis/pool#remove to document the change in behavior
note: if we want to merge this, then i should update the docs for https://node-postgres.com/apis/pool#remove to document the change in behavior
Would you consider this a bug-fix or a breaking change? Seems to me like its a semantic alignment w/ expectations and more of a fix than a break, and no exising tests required changing so its more of a patch than a semver major. But I'd love to hear your thoughts!
I agree this is a fix. No one expects pool.end
to resolve before the last pool.query
. Also, the documentation did not state that remove
event is emitted prior to client end finishing.
edit:
Docs for remove event:
Whenever a client is closed & removed from the pool the pool will emit the remove event.
So, I would say that the expectation is that the client has been closed. Even more strongly in the "fix" camp. Maybe no change in behavior needs to be documented either.
Uh oh!
There was an error while loading. Please reload this page.
dupe of #3254 with 289273c to fix the failing test