-
Notifications
You must be signed in to change notification settings - Fork 258
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
Is there any hooks for .on('error') to remove a driver from the pool? #31
Comments
hey there, Yep, try using pool.destroy(obj) instead of pool.release(obj) - destroy() does that help? -- James On Thu, Feb 2, 2012 at 11:30 AM, Mark Cavage <
James Cooper |
Oh ok - so just do it "outside" of the pool. I was asking if pool could just manage this automatically (that would be a nice new feature). |
ah.. yeah, I guess I'm open to it. Feel free to propose a design. Are -- James On Thu, Feb 2, 2012 at 11:48 AM, Mark Cavage <
James Cooper |
Well, I guess we could do that too (health check on acquire). I was actually thinking more of .on('error') it could go into a "destroy -> create". I dunno, maybe it's not worth it if it's wrapped outside of the pool. Because either way (health check or error-based), it does feel like you'd have to do retry/backoff, otherwise you could end up in a "spin" when the backend resource is out. |
right, exactly. .on(error) seems similar to .destroy(obj) -- in either DBCP for Java has health check hooks, so I'd be open to adding something -- James On Thu, Feb 2, 2012 at 11:54 AM, Mark Cavage <
James Cooper |
Yeah I think a health check hook like jakarta's that's executed outside of my normal code flows would actually get me the same thing - so sold :) |
Sweet. I'll keep this issue open as a placeholder. swamped a bit at the On Thu, Feb 2, 2012 at 12:53 PM, Mark Cavage <
James Cooper |
Going to close due to age reasons. Feel free to re-open if this issue is still relevant anyone. |
Hi,
Great module - I didn't see it from briefly scanning your code: it's pretty common that with various drivers (especially stateful/long-lived ones), I'd want to have the pool auto-purge a client that emits an error event, so it can recreate another one to replace it. Is there a way to do that?
Thanks!
~Mark
The text was updated successfully, but these errors were encountered: