-
Notifications
You must be signed in to change notification settings - Fork 12
Replace the pool when reopening. #181
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
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.
Pull Request Overview
This PR implements a connection pool reopening mechanism by storing configuration and stats exporter references, allowing pools to be replaced when closed and reopened. This is a backport of a previous fix aimed at properly handling pool lifecycle management.
- Stores pool configuration and stats exporter references for later reuse
- Replaces the underlying connection pool when closing to enable clean reopening
- Introduces proper pool state management with atomic operations
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| go/vt/vttablet/tabletserver/connpool/pool.go | Stores config and stats exporter, replaces ConnPool on close |
| go/vt/dbconnpool/connection_pool.go | Adds config storage and Close method that replaces the pool |
| go/pools/smartconnpool/pool_test.go | Adds test for connection reopening behavior |
| go/pools/smartconnpool/pool.go | Implements pool state management and separate StatsExporter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
431ad94 to
fd4ed7b
Compare
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
When closing the pool, there is a race condition between the closing of the `close` channel in `CloseWithContext`, and the `maybeStarving` worker closing it. We'll remove the close in `CloseWithContext` and allow the worker to close it on its next run. Signed-off-by: Mohamed Hamza <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
closing and normal operations Signed-off-by: Mohamed Hamza <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
fd4ed7b to
32f06d3
Compare
d27a57e to
bed0c14
Compare
Description
This is a backport of vitessio#18530
Related Issue(s)
Checklist
Deployment Notes