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

Open
wants to merge 2 commits into
base: release-19.0-github
Choose a base branch
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

@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 {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant