Skip to content
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

Remove disconnected clients from the pool #543

Merged
merged 2 commits into from
Mar 22, 2014

Conversation

strk
Copy link
Contributor

@strk strk commented Mar 17, 2014

Might fix #458
Fixes CartoDB/CartoDB-SQL-API#135

Tested against 2.11.1

@strk
Copy link
Contributor Author

strk commented Mar 17, 2014

This pull request replaces #537

@strk
Copy link
Contributor Author

strk commented Mar 18, 2014

Ok I found an issue with this commit in that pool.destroy triggers 'end' event again, so needs some preotection. I'll add one in next commit.

@brianc
Copy link
Owner

brianc commented Mar 22, 2014

awesome! This is definitely a good idea. I always took the approach that you remove a client from the pool by passing truthy value to the release callback from the pg.connect(function(err, client, release)) callback - but this makes perfect sense & will help for when clients are ended outside of that mechanism.

brianc added a commit that referenced this pull request Mar 22, 2014
Remove disconnected clients from the pool
@brianc brianc merged commit b12dd4c into brianc:master Mar 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No response on backend (postgresql) crash Check pg connection
2 participants