-
Notifications
You must be signed in to change notification settings - Fork 183
fix(pool): synchronously release pool connection after query results Fix/conn release #402
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
dhmlau
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@STRML, thanks for the PR. Your changes look reasonable to me.
I'm not sure if we can add some tests for that. Would like to get other maintainers to review it as well. Thanks.
|
Just realized the errors after approving the PR. @STRML, could you please fix the commit linter error? Thanks. |
elv1s
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good after fixing the commit message
|
Fixed commit message. |
d32e3e6 to
6ebfcb9
Compare
To speed up the process, I am going to fix the commit message myself. |
Rapidly-fired queries can exhaust the pool capability and lead to odd results. In test, we've witnessed "Connection Terminated" flakiness with many fast test suites. This, combined with setting `lazyConnect: true` and `idleTimeoutMillis: 0`, alleviates the issue.
6ebfcb9 to
72a012e
Compare
The build failure looks unrelated to me, let's re-run the tests again. IIRC, we are observing this error from time to time, it would be great if somebody could investigate the problem and contribute a fix. /cc @strongloop/loopback-connector-postgresql-maintainers |
|
@slnode test please |
|
Landed, thank you @STRML for the contribution ❤️ |
|
Published as |
Removes the
process.nextTick()wrapping the release callback after callingpg.Pool#connect().This was questioned in this comment and never removed. We found test flakiness that was alleviated after removing this unnecessary tick.
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machine