-
-
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
Remove client from pool on connection end #537
Conversation
Might fix brianc#458 Definitely fixes CartoDB/CartoDB-SQL-API#135
I don't understand the failing test (idle-timeout-tests.js). |
Ok I do see that an "end" event is also emitted by the client at the end of a query, even with no error. In those cases we don't really want to remove the item from the pool. So what we'd need is a way to distinguish "good" connections from "bad" connections. |
Instead, consider receiving a premature stream end while a query is in progress as an error sign, bubbling up the error to the client level. Fixes the testsuite while still fixing my cases and possibly brianc#458. The correct fix would be to provide a .validate method to the pooler, and expose a .validate method to the client and to the connection classes for that purpose...
Still doesn't fix all cases of connection breaking after successful connection.
And subsequently failing to error out on an attempt to use the connection from the pool :'( |
This new on fails ./test/unit/client/stream-and-query-error-interaction-tests.js ARGH (I love testcases :) |
I do not think emitting an |
On Sun, Mar 16, 2014 at 07:41:09PM -0700, Brian C wrote:
Agreed, see a3a1cc9 --strk; |
Sorry, you meant it's not good to get 'error' when calling client.end() |
I actually think removing 'end'-ed connections from the pool is correct, but let's close this pull, too confusing. Will file a cleaner one. |
Might fix #458
Definitely fixes CartoDB/CartoDB-SQL-API#135