Skip to content

util/async: avoid blocking Append on Exec cancellation - #2092

Closed
lcwangchao wants to merge 1 commit into
tikv:release-nextgen-20251011from
lcwangchao:cherry-pick-2034-to-release-nextgen-20251011
Closed

lcwangchao wants to merge 1 commit into
tikv:release-nextgen-20251011from
lcwangchao:cherry-pick-2034-to-release-nextgen-20251011

Conversation

@lcwangchao

Copy link
Copy Markdown
Contributor

What

Backport #2034 to release-nextgen-20251011.

This fixes the RunLoop cancellation race from #2033, where Append could block indefinitely if a waiting Exec returned on ctx.Done() after Append had already committed to notify through ready.

Why

The branch still has the pre-fix util/async/runloop.go implementation and is therefore still affected by the race.

Tests

  • go test ./util/async

Cherrypick

fix tikv#2033

Signed-off-by: zyguan <zhongyangguan@gmail.com>
(cherry picked from commit 392411f)
@ti-chi-bot ti-chi-bot Bot added the dco-signoff: yes Indicates the PR's author has signed the dco. label Sep 28, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign connor1996 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 28, 2026
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 9266a3a5-c984-4f90-aecb-67e31ca554d3

📥 Commits

Reviewing files that changed from the base of the PR and between 92f26c7 and 0b7701f.

📒 Files selected for processing (2)
  • util/async/runloop.go
  • util/async/runloop_test.go
 ___________________________________________________
< Stack Overflow called, they want their code back. >
 ---------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lcwangchao lcwangchao closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants