-
Notifications
You must be signed in to change notification settings - Fork 947
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
[RFC]refactor: refact the container lock #2756
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2756 +/- ##
=========================================
- Coverage 69.39% 69.3% -0.09%
=========================================
Files 277 277
Lines 17435 17347 -88
=========================================
- Hits 12099 12023 -76
+ Misses 4008 3993 -15
- Partials 1328 1331 +3
|
Maybe get deadlock somewhere or other reason, ci hang long make test fail |
@Ace-Tang yes, I will figure it out |
62b1d65
to
15bcd29
Compare
@HusterWan , does ths ready for review now? |
Yes, you can review now. |
@HusterWan As we know, read ops are more than write ops, so rwlock is a good suggestion. |
@wangforthinker agree with you. actually, we only have one container read ops, just |
I think we should add lock for Create. Since we set the container name at the ending of function, it might create two containers with the same name. WDYT? |
I think we should change the time when to put name->id to the cache in case we may create containers with the same name. Using container Lock cannot fix the problem. |
I can create a new pr to fix this problem. |
@HusterWan , please rebase, since I fix a bug in #2757 |
done |
Please solve the conflict and sync the latest code, and then we can move to consider merging. @HusterWan |
… api Signed-off-by: Michael Wan <zirenwan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
refactor: refact the container lock, put a big lock for all container api Signed-off-by: Michael Wan <zirenwan@gmail.com> cherry-pick from github AliyunContainerService#2756 See merge request !304119
Signed-off-by: Michael Wan zirenwan@gmail.com
Ⅰ. Describe what this PR did
Since the single container APIs have not occurred performance problem and the Fine-grained locking mechanism has occurred many concurrency problems, so we decide to change to Coarse-grained locking mechanism that will lock all operations in one API function.
Of course, we should make sure this change has no influence on the legacy containers and the CRI interfaces, so we will first make all test cases happy, then consider to merge this pr.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews