Fix of pool leaking by TCP-keepalive #918
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is some bug with connection pool.
To reproduce it - you need connect to postgresql, start request and kill db process by kill -9. Client will not be free on any time.
To fix this, we can add heartbeat to client connection (#913) or add TCP-keepalive.
I have tested it. On TCP-socket close it return error to
client#query
callback function. I think, that it is the best resolve of this problem.P.S. Please, if you will merge one of my PR - close another one.