Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workerpool: remove mergeContext (#2201) #2489

Conversation

amyangfei
Copy link
Contributor

This is an automated cherry-pick of #2201

What problem does this PR solve?

  • mergeContext spawns a goroutine when Done() is called for the first time. Since we generate a mergeContext for each event before calling its handler, when concurrency is high, we will be running a large number of goroutines concurrently, and these goroutines do little that's useful.

Close #2211

What is changed and how it works?

  • Remove mergeContext completely. Event handler calls can only be cancelled with the ctx used to add that event. They will no longer be cancelled when the workerpool is cancelled.

Check List

Tests

  • Unit test
  • Integration test

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Optimize workerpool for fewer goroutines when concurrency is high.

@amyangfei amyangfei added subject/performance Denotes an issue or pull request is related to replication performance. release-blocker This issue blocks a release. Please solve it ASAP. labels Aug 10, 2021
@amyangfei amyangfei added this to the v5.2.0 milestone Aug 10, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot
Copy link
Member

@amyangfei: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Aug 10, 2021
@ti-chi-bot ti-chi-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 10, 2021
@amyangfei amyangfei added the type/cherry-pick-for-release-5.2 This PR is cherry-picked to release-5.2 from a source PR. label Aug 10, 2021
@purelind
Copy link
Collaborator

/run-all-tests

@amyangfei
Copy link
Contributor Author

/run-all-tests /tikv=release-5.2

@amyangfei amyangfei added the status/LGT2 Indicates that a PR has LGTM 2. label Aug 10, 2021
@ti-chi-bot ti-chi-bot removed the status/LGT2 Indicates that a PR has LGTM 2. label Aug 10, 2021
@amyangfei amyangfei added the require-LGT1 Indicates that the PR requires an LGTM. label Aug 10, 2021
@amyangfei
Copy link
Contributor Author

amyangfei commented Aug 10, 2021

Close this PR since it will be picked in https://github.com/pingcap/ticdc/pull/2490

@amyangfei amyangfei closed this Aug 10, 2021
@amyangfei amyangfei deleted the cherry-pick-2201-to-release-5.2 branch August 10, 2021 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. release-blocker This issue blocks a release. Please solve it ASAP. require-LGT1 Indicates that the PR requires an LGTM. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. subject/performance Denotes an issue or pull request is related to replication performance. type/cherry-pick-for-release-5.2 This PR is cherry-picked to release-5.2 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants