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

[#2127] Improvement(core): improve TreeLock for ease of unlock and fix unexpected err when lock failed #2141

Merged
merged 7 commits into from
Feb 18, 2024

Conversation

YxAc
Copy link
Contributor

@YxAc YxAc commented Feb 7, 2024

What changes were proposed in this pull request?

  • improve TreeLock for ease of unlock by keeping lock type
  • fix unexpected err when lock failed and unlock all nodes that have been locked

Why are the changes needed?

Fix: #2127

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

UT

@yuqi1129
Copy link
Contributor

yuqi1129 commented Feb 7, 2024

@YxAc
Can you add some tests about the scenario when the method lock fails (throws exceptions) and everything is still okay, that is: we can unlock the nodes that have been locked. You can mock the lock method and do some corresponding tests for it. There are some similar tests in the TestLockManager, you can refer to them.

@YxAc
Copy link
Contributor Author

YxAc commented Feb 8, 2024

@YxAc Can you add some tests about the scenario when the method lock fails (throws exceptions) and everything is still okay, that is: we can unlock the nodes that have been locked. You can mock the lock method and do some corresponding tests for it. There are some similar tests in the TestLockManager, you can refer to them.

done

yuqi1129
yuqi1129 previously approved these changes Feb 9, 2024
Copy link
Contributor

@yuqi1129 yuqi1129 left a comment

Choose a reason for hiding this comment

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

It's okay with me, @jerryshao . Could you spare some time to take a look?

add trace log judgement
Copy link
Contributor

@jerryshao jerryshao left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks @YxAc for your contribution.

@jerryshao jerryshao merged commit c42fb7d into apache:main Feb 18, 2024
5 checks passed
@YxAc YxAc deleted the improve_treelock_ease_unlock branch February 18, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Keep Lock type in each TreeLockNode for ease of unlock
3 participants