-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Emit a 'release' event when a connection is released back to the pool #2845
Emit a 'release' event when a connection is released back to the pool #2845
Conversation
7cf4cbe
to
f77824c
Compare
@brianc let me know if you need anything more from me on this. Happy to help get this merged in whatever way you need. Thanks! |
Nice, looks like this could also be used to count the number of open connections? |
@weyert You could, but I think it's probably easier to use the existing properties If you wanted to do it via events, there are also existing events emitted:
What this PR adds is the balancing |
This looks perfectly good to me! Thank you so much! Agree the symmetry here is nice and kinda long standing silly oversight on my part to not do that to begin with. 😄 ❤️ |
okay weirdly....the tests don't seem to have run for this PR? Would you be able to try rebasing on |
Hey @brianc -- sorry for the delay in getting back to this. I've synced my fork, and CI seems to be running. Thanks! |
@brianc Any chance we can get this one merged soon? |
Hey, @brianc -- sorry to ping again, but it's been a while. Hoping to get this PR merged soon. We're currently operating off of a local branch incorporating this change, and I'd really like to be able to come back to the origin distribution if possible. Let me know if you need anything from me to make this happen. Thanks! |
@brianc just checking in again -- would love to get this PR merged soon, so we can get off this branch build. Let me know if there's anything more you need here. |
sorry for delay! Will release it today! |
Added in brianc/node-postgres#2845 and released as part of version 8.10.0.
This PR has the
Pool
object emit a'release'
event upon the release of a client/connection back to the pool.We're experiencing an issue that feels quite similar to what's described in #2262, and in reading through the comments there, I was interested to see @brianc's suggestion of adding a
'release'
event as the corresponding bookend to the'connect'
and'acquire'
events. However, in searching the code, it seems this was never implemented, so I've implemented that here.