Skip to content

release-25.4: sql/stats: nil-check cache in TableStatisticsCache.Stop#169690

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

release-25.4: sql/stats: nil-check cache in TableStatisticsCache.Stop#169690
blathers-crl[bot] wants to merge 1 commit intorelease-25.4from
blathers/backport-release-25.4-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-25.4-169624 branch from f728e0b to cf3bba0 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 DrewKimball 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
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented May 4, 2026

Merging to release-25.4 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
Copy link
Copy Markdown
Author

blathers-crl Bot commented May 4, 2026

Thanks for opening a backport.

Before merging, please confirm that it falls into one of the following categories (select one):

  • Non-production code changes OR fixes for serious issues. Non-production includes test-only changes, build system changes, etc. Serious issues are defined in the policy as correctness, stability, or security issues, data corruption/loss, significant performance regressions, breaking working and widely used functionality, or an inability to detect and debug production issues.
  • Other approved changes. These changes must be gated behind a disabled-by-default feature flag unless there is a strong justification not to. Reference the approved ENGREQ ticket in the PR body (e.g., "Fixes ENGREQ-123").

Add a brief release justification to the PR description explaining your selection.

Also, confirm that the change does not break backward compatibility and complies with all aspects of the backport policy.

All backports must be reviewed by the TL and EM for the owning area.

@blathers-crl blathers-crl Bot requested review from ZhouXing19 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)

1 similar comment
@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