-
Notifications
You must be signed in to change notification settings - Fork 8.9k
optimize : reorganize the usage of task session manager(add/remove/find/update) #4858
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
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## 2.x #4858 +/- ##
============================================
- Coverage 48.78% 48.73% -0.06%
+ Complexity 4164 4157 -7
============================================
Files 743 743
Lines 26588 26577 -11
Branches 3320 3320
============================================
- Hits 12970 12951 -19
- Misses 12220 12229 +9
+ Partials 1398 1397 -1
|
|
sessionMnager改造终态分4步 |
server/src/main/java/io/seata/server/session/SessionHolder.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/session/SessionHolder.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/session/SessionHolder.java
Outdated
Show resolved
Hide resolved
funky-eyes
left a comment
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
funky-eyes
left a comment
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
|
pr做的不够干净,关联一下后续 #5604 |
Ⅰ. Describe what this PR did
重新整理SessionHolder里面的几个sessionManager,统一把对globalsession的增删查改都改为使用root manager。
现在还没正式改好代码,我把需要改的地方全部todo标注出来,后面改的时候每改一个就删一个todo注释。以下是梳理情况:
查询(把有非root的地方改成root.findxx ,真正要改的地方只有3个,已经用红色圈出来)




allsessions本来在不同的manager有自带不同的查询条件,但现在看起来已经被改造过了
删除(把有非root的地方改成root.removexx ,真正要改的地方只有4个,已经用红色圈出来)

更新(实际上只有changeStatus调用,但用到这个的地方很多,经过讨论决定把listener逻辑从manager摘出去)

新增(分两种情况,1是真正的新增,改成root.addxx ,2其实是更新,改成root.updatexx,具体属于1还是2可以看代码todo标识)

Ⅱ. Does this pull request fix one issue?
部分解决 #4857
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews