-
Notifications
You must be signed in to change notification settings - Fork 5.2k
upstream: add connpool map #5670
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
This class allows clients to map keys to connection pools, returning the existing pool if it already exists. Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
|
/retest |
|
🔨 rebuilding |
|
/retest |
|
🔨 rebuilding |
We were crashing due to the callback firing mid-iteration and clearing the pool. Check for that case and handle it. Signed-off-by: Kyle Larose <kyle@agilicus.com>
|
/retest |
|
🔨 rebuilding |
|
@mattklein123 Any chance you'll be able to take a look at this in the next few days? Thanks! |
|
Yes will do, sorry for the delay. |
mattklein123
left a comment
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.
Thanks and sorry for the review delay. At a high level this looks great. Some comments to get started and then I will take another pass.
/wait
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
- Fix up comments - Add protection against recursion - Change optional pointer to a reference Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
|
@mattklein123 Changes made! Thanks for the feedback. |
mattklein123
left a comment
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.
Thanks this looks good. A few small comments.
/wait
- General cleanup - Make recursion checker debug only Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
|
/retest |
|
🔨 rebuilding |
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
|
/retest |
|
🔨 rebuilding |
|
@mattklein123 Thanks for kicking off the retest. Looks like everything is passing now. I've addressed all your comments. |
mattklein123
left a comment
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.
Looks good, just a few tiny nits then good to go! Thank you!
/wait
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
mattklein123
left a comment
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.
Thank you!
This class allows clients to map keys to connection pools, returning the existing pool if it already exists. Signed-off-by: Kyle Larose <kyle@agilicus.com> Signed-off-by: Fred Douglas <fredlas@google.com>
Description: This introduces a dedicated class --
ConnPoolMap-- to handle the mapping of "key" to connection pool.The idea here is that very soon (as part of the work for #4128) we will have an unbounded set of mappings, meaning that we need to manage the life-cycle of these mapped connection pools. Rather than try to do so within
ClusterManager, it makes sense to push that responsibility into its own class. This PR starts by refactoringClusterManager's interaction with the mapping so that it happens entirely through the new class. Future PRs will introduce the life-cycle management.A few things of note:
ClusterManagerperformed a few operations on the entries in the map -- iterating to add callbacks, draining, etc -- that have been refactored into a single operation on the map. This is probably a good thing, but we should make sure that behaviour wasn't changed here. I don't think any has been.Dispatcher, where previously it did not.Risk Level: High. Integrates into the core upstream behaviour, but I've striven to ensure that no behaviour changed.
Testing: Unit testing, integration testing.