Skip to content

initialize pool from scratch after TableGC.Close #157

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

Closed
wants to merge 2 commits into from

Conversation

mhamza15
Copy link

Description

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Signed-off-by: Mohamed Hamza <mhamza15@github.com>
@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 20:15
Copy link

@Copilot Copilot AI left a 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 refactors the TableGC pool initialization by extracting it into a helper and ensures the pool can be reinitialized after being closed.

  • Extracted connpool.NewPool calls into a new newPool helper.
  • Added nil-check in Open() to recreate the pool if it was closed.
  • Updated Close() to properly close and nil out the pool.
Comments suppressed due to low confidence (2)

go/vt/vttablet/tabletserver/gc/tablegc.go:716

  • [nitpick] The helper function name newPool is generic. Consider renaming it to newTableGCPool for clarity in this context.
func newPool(env tabletenv.Env) *connpool.Pool {

go/vt/vttablet/tabletserver/gc/tablegc.go:176

  • There are no tests covering the scenario where Open() is called after Close(). Add a unit test to verify the pool is reinitialized correctly.
if collector.pool == nil {

Signed-off-by: Mohamed Hamza <mhamza15@github.com>
Copy link

This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

@github-actions github-actions bot added the Stale label Jun 20, 2025
Copy link

This PR was closed because it has been stale for 7 days with no activity.

@github-actions github-actions bot closed this Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant