Skip to content

release-26.1: sql/stats: nil-check cache in TableStatisticsCache.Stop#169692

Open
blathers-crl[bot] wants to merge 1 commit intorelease-26.1from
blathers/backport-release-26.1-169624
Open

release-26.1: sql/stats: nil-check cache in TableStatisticsCache.Stop#169692
blathers-crl[bot] wants to merge 1 commit intorelease-26.1from
blathers/backport-release-26.1-169624

Conversation

@blathers-crl
Copy link
Copy Markdown

@blathers-crl blathers-crl Bot commented May 4, 2026

Backport 1/1 commits from #169624 on behalf of @SAY-5.


Fixes #169306

The closer registered in NewTableStatisticsCache calls tableStatsCache.Stop. The closer is registered before sc.mu.cache is initialised on line 310. If the parent stopper begins draining closers during cache construction (rare, but observed in TestServerController on shared-process tenants), Stop fires on a partially-initialised cache and sc.mu.cache.Clear() nil-derefs. Guard the Clear call with a nil check; acc.Clear and mon.Stop are already either no-ops or guarded.

Release note: None


Release justification: fix a missing nil check that could cause panic on user end.

Signed-off-by: SAY-5 <say.apm35@gmail.com>
@blathers-crl blathers-crl Bot force-pushed the blathers/backport-release-26.1-169624 branch from 65223b1 to a507967 Compare May 4, 2026 18:55
@blathers-crl blathers-crl Bot requested a review from a team as a code owner May 4, 2026 18:55
@blathers-crl blathers-crl Bot requested review from ZhouXing19 and removed request for a team May 4, 2026 18:55
@blathers-crl blathers-crl Bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels May 4, 2026
@blathers-crl
Copy link
Copy Markdown
Author

blathers-crl Bot commented May 4, 2026

Thanks for opening a backport.

Before merging, please confirm that the change does not break backwards compatibility and otherwise complies with the backport policy. Include a brief release justification in the PR description explaining why the backport is appropriate. All backports must be reviewed by the TL for the owning area. While the stricter LTS policy does not yet apply, please exercise judgment and consider gating non-critical changes behind a disabled-by-default feature flag when appropriate.

@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented May 4, 2026

Merging to release-26.1 in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@blathers-crl blathers-crl Bot requested review from DrewKimball and michae2 May 4, 2026 18:55
@blathers-crl blathers-crl Bot added backport Label PR's that are backports to older release branches T-sql-queries SQL Queries Team labels May 4, 2026
@blathers-crl
Copy link
Copy Markdown
Author

blathers-crl Bot commented May 4, 2026

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@ZhouXing19 ZhouXing19 requested review from mw5h and removed request for DrewKimball, ZhouXing19 and michae2 May 4, 2026 19:02
@blathers-crl
Copy link
Copy Markdown
Author

blathers-crl Bot commented May 4, 2026

Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Label PR's that are backports to older release branches blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. T-sql-queries SQL Queries Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants