fix: avoid data branch merge channel race - #24583
Conversation
Capture the result channel before launching the data branch output goroutine so later cleanup cannot nil the channel seen by the consumer. Fixes matrixorigin#24568 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed the current head 0d4a025 from multiple angles. The fix is correct on main as well: the output goroutine now captures the result channel before launch, so later cleanup setting retBatCh = nil cannot make the consumer range over a nil channel and hang. I also checked the surrounding producer/consumer flow in diffMergeAgency, newEmitter, satisfyDiffOutputOpt, pickMergeDiffs, and mergeDiffs; I did not find a remaining blocking issue in the current patch.
Merge Queue Status
This pull request spent 48 minutes 9 seconds in the queue, including 47 minutes 30 seconds running CI. Waiting for
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks Failing checks: HintYou may have to fix your CI before adding the pull request to the queue again. |
Merge Queue Status
This pull request spent 8 hours 56 minutes 49 seconds in the queue, including 5 hours 6 minutes 27 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) does this PR fix or relate to?
Fixes #24568
What this PR does / why we need it:
Test