-
Notifications
You must be signed in to change notification settings - Fork 984
Easier setup for connection pool events subscription : onLease/onRelease #771
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
Conversation
|
@neoXfire Sure. We can do that. Please add a symmetric change to |
31c00d6 to
afb1a45
Compare
|
@neoXfire Please fix the code style violations. Looks good otherwise. |
9ea2c7e to
6f99a00
Compare
|
Hello @ok2c, Thank you for the quick feedback. Please note one of the new pool implementation in core5 ( I was wondering if I should also update the core so that pool event subscription is consistent between all implementations ? |
@neoXfire Yes, please do so. Could you please also add a TODO comment to |
I’m not convinced OFFLOCK needs ConnPoolListener at all. |
…syncClientConnectionManagerBuilder` to configure a listener for connection pool events (onLease/onRelease) This can be use to implement custom instrumentation (time blocked in http pool for example)
6f99a00 to
d67ac66
Compare
@arturobernalg This may well be the case, null listener should have no performance impact, should it? And if the user explicitly chooses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am in favor of committing this change-set
@ok2c Agreed. Null listener is a no-op on the hot path apart from a predictable null check, so it should not have any measurable impact. |
I think with an appropriate implentation (notification callbacks stored in a If there is no intent to drop STRICT and LAX support in the future to replace it by this new lock-free implementation OFFLOCK only, it is fine and I can probably stick to the two legacy implementations only for my change. However, if it is actually the plan, I think you should try to find the right balance between raw performance and thrid-party plugability (observability, instrumentation...). That last aspect is for a lot of people as important as the first one. Regards, |
|
@neoXfire Will you also create a follow-up pull request for OFFLOCK pool in core? @arturobernalg would you rather do it yourself? |
I'll do the change @ok2c . I'm just waiting that the running the performance test ended . |
Hi all,
Here is a proposal to enrich
PoolingHttpClientConnectionManagerBuilderwith a new method to customize theConnPoolListener<HttpRoute>used in the underlying pool.That will allow to implement custom instrumentation, to measure the time spent waiting in the pool before a connection get available for example.
Regards,