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

concurrency manager: fix a memory leak when iterating skiplist #9722

Merged
merged 2 commits into from
Mar 4, 2021

Conversation

sticnarf
Copy link
Contributor

@sticnarf sticnarf commented Feb 27, 2021

What problem does this PR solve?

When checking memory locks of a range, memory leaks happen.

What is changed and how it works?

It's due to a bug in crossbeam-skiplist. I fix it in my own branch and this PR will fix it.

Fixed in upstream: crossbeam-rs/crossbeam#673

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Run long-running tests to see if memory leaks still exist manually.

Release note

  • Fix memory leaks when checking a range for memory locks.

Copy link
Contributor

@youjiali1995 youjiali1995 left a comment

Choose a reason for hiding this comment

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

/LGTM. Have you opened a PR to the upstream?

@ti-chi-bot ti-chi-bot added the status/LGT1 Status: PR - There is already 1 approval label Mar 2, 2021
@sticnarf
Copy link
Contributor Author

sticnarf commented Mar 2, 2021

@youjiali1995 There appears to be other more minor leaks and I am looking for the reason. I want to open the PR after finding the others.

Copy link
Contributor

@nrc nrc left a comment

Choose a reason for hiding this comment

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

lgtm, obviously we should move back to mainline asap.

git = "https://github.com/crossbeam-rs/crossbeam.git"
tag = "crossbeam-0.7.3"
git = "https://github.com/sticnarf/crossbeam.git"
branch = "tikv"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should use a ref rather than a branch to ensure we're all building the same version

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nrc
  • youjiali1995

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels Mar 3, 2021
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
[dependencies.crossbeam-skiplist]
git = "https://github.com/crossbeam-rs/crossbeam.git"
tag = "crossbeam-0.7.3"
git = "https://github.com/sticnarf/crossbeam.git"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although the fix is already merged to the upstream, I use my own branch to make it possible to use the crates.io version of crossbeam-utils and crossbeam-epoch.

Copy link
Contributor

Choose a reason for hiding this comment

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

just curious, what are the advantages of the crates.io version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just don't want another copy of these dependencies...

@sticnarf
Copy link
Contributor Author

sticnarf commented Mar 4, 2021

@nrc @youjiali1995 Please take a second look

Copy link
Contributor

@youjiali1995 youjiali1995 left a comment

Choose a reason for hiding this comment

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

/lgtm

@sticnarf
Copy link
Contributor Author

sticnarf commented Mar 4, 2021

/merge

@ti-chi-bot
Copy link
Member

@sticnarf: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 4c4bf75

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Mar 4, 2021
@ti-chi-bot
Copy link
Member

@sticnarf: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit d45d321 into tikv:master Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/transaction SIG: Transaction size/M status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants