Skip to content

Conversation

@blathers-crl
Copy link

@blathers-crl blathers-crl bot commented Jan 7, 2026

Backport 1/1 commits from #160420 on behalf of @blathers-crl[bot].


Backport 1/1 commits from #160348 on behalf of @mw5h.


Before this change, when the sampleAggregator or sampler processors panicked during row processing, cleanup code (ConsumerClosed() and ProducerDone()) was never executed. This left producer goroutines blocked indefinitely on channel sends, which prevented the flow from completing. During cluster drain operations, this caused the drain to hang indefinitely waiting for flows to finish.

This change adds deferred cleanup to both processors' Run() methods, ensuring that ConsumerClosed() is called even when a panic occurs. This unblocks stuck producers and allows panics to be properly recovered without causing deadlocks.

A new test verifies the fix by injecting a panic via testing knob and confirming that producer goroutines complete successfully.

Fixes: #160337

Release note (bug fix): Fixed a deadlock that could occur when a statistics creation task panicked.

🤖 Generated with Claude Code


Release justification: Focused fix for an issue discovered at a customer site.


Release justification:

Before this change, when the sampleAggregator or sampler processors
panicked during row processing, cleanup code (ConsumerClosed() and
ProducerDone()) was never executed. This left producer goroutines
blocked indefinitely on channel sends, which prevented the flow from
completing. During cluster drain operations, this caused the drain to
hang indefinitely waiting for flows to finish.

This change adds deferred cleanup to both processors' Run() methods,
ensuring that ConsumerClosed() is called even when a panic occurs.
This unblocks stuck producers and allows panics to be properly recovered
without causing deadlocks.

A new test verifies the fix by injecting a panic via testing knob and
confirming that producer goroutines complete successfully.

Fixes: #160337

Release note (bug fix): Fixed a deadlock that could occur when a
statistics creation task panicked.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@blathers-crl blathers-crl bot requested a review from a team as a code owner January 7, 2026 01:29
@blathers-crl blathers-crl bot force-pushed the blathers/backport-release-25.3.7-rc-160420 branch from a9e08ad to 7d29b77 Compare January 7, 2026 01:29
@blathers-crl blathers-crl bot requested review from ZhouXing19 and removed request for a team January 7, 2026 01:29
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Jan 7, 2026
@blathers-crl blathers-crl bot self-assigned this Jan 7, 2026
@blathers-crl
Copy link
Author

blathers-crl bot commented Jan 7, 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.

@blathers-crl blathers-crl bot requested review from michae2 and yuzefovich January 7, 2026 01:29
@blathers-crl blathers-crl bot added the backport Label PR's that are backports to older release branches label Jan 7, 2026
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich yuzefovich changed the title release-25.3.7-rc: release-25.3: rowexec: fix deadlock when processors panic during execution release-25.3.7-rc: rowexec: fix deadlock when processors panic during execution Jan 7, 2026
Copy link
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yuzefovich yuzefovich merged commit 310e203 into release-25.3.7-rc Jan 7, 2026
15 of 16 checks passed
@yuzefovich yuzefovich deleted the blathers/backport-release-25.3.7-rc-160420 branch January 7, 2026 02:16
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. target-release-25.3.7

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants