Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Bughue
Copy link
Contributor

@Bughue Bughue commented Aug 23, 2022

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

https://github.com/seata/seata/issues/4857的问题里,分两个pr解决

这个pr做了以下几件事

  1. AbstractSessionManager不再实现SessionLifecycleListener
  2. 去掉所有session.addlistener的操作(因为现在已经没有类属于SessionLifecycleListener)
  3. SessionManager不再继承SessionLifecycleListener,SessionManager里面定义和SessionLifecycleListener同名的方法(用于处理主流程),这样AbstractSessionManager里面的方法实现无需改动,但调用方需要整改(并删掉getRetryRollbackingSessionManager()和getRetryCommittingSessionManager())
  4. GlobalSession作为调用方,在所有遍历lifecycleListeners之前,优先调用SessionHolder.getRootSessionManager()的同名方法进行主逻辑处理
  5. AbstractSessionManager的updateGlobalSessionStatus方法要进行set status
  6. 单测整改(涉及sessionholder的地方要初始化,xid缺失的地方要补充)

这个pr把addlistener的操作已经全部去掉,但这个方法和listener自身机制保留(目前闲置),以后有必要再使用
由于现在SessionLifecycleListener只有被GlobalSession调用,所以只需要改好GlobalSession就可以
image
上图是用临时改方法名的方法用错误统计来显示全部的调用

Ⅱ. Does this pull request fix one issue?

fixes #4857

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2022

Codecov Report

Merging #4881 (0feda8b) into 2.x (4b724e2) will decrease coverage by 0.11%.
The diff coverage is 100.00%.

📣 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

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #4881      +/-   ##
============================================
- Coverage     48.51%   48.40%   -0.11%     
+ Complexity     4188     4167      -21     
============================================
  Files           764      764              
  Lines         26924    26892      -32     
  Branches       3348     3348              
============================================
- Hits          13061    13016      -45     
- Misses        12475    12479       +4     
- Partials       1388     1397       +9     
Impacted Files Coverage Δ
...java/io/seata/server/coordinator/AbstractCore.java 54.02% <ø> (-1.04%) ⬇️
.../java/io/seata/server/coordinator/DefaultCore.java 47.59% <ø> (-0.65%) ⬇️
...in/java/io/seata/server/session/SessionHolder.java 60.18% <ø> (-1.24%) ⬇️
...o/seata/server/coordinator/DefaultCoordinator.java 44.89% <100.00%> (-2.12%) ⬇️
...o/seata/server/session/AbstractSessionManager.java 62.31% <100.00%> (+0.55%) ⬆️
...in/java/io/seata/server/session/GlobalSession.java 69.92% <100.00%> (-10.61%) ⬇️
...ver/storage/db/session/DataBaseSessionManager.java 41.17% <100.00%> (+4.33%) ⬆️
...rage/redis/store/RedisTransactionStoreManager.java 74.67% <0.00%> (-0.79%) ⬇️
... and 4 more

@Bughue Bughue changed the title [WIP] optimize : reorganize the usage of task session manager(separate listener and manager) optimize : reorganize the usage of task session manager(separate listener and manager) Aug 24, 2022
@Bughue Bughue changed the title optimize : reorganize the usage of task session manager(separate listener and manager) [WIP]optimize : reorganize the usage of task session manager(separate listener and manager) Aug 29, 2022
@slievrly slievrly added the TC/store store mode label Sep 7, 2022
…ager_x_listener

� Conflicts:
�	server/src/main/java/io/seata/server/coordinator/DefaultCore.java
@CLAassistant
Copy link

CLAassistant commented Dec 12, 2022

CLA assistant check
All committers have signed the CLA.

Bughue and others added 3 commits January 17, 2023 18:15
…ager_x_listener

� Conflicts:
�	server/src/main/java/io/seata/server/session/GlobalSession.java
…_x_listener

� Conflicts:
�	server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java
�	server/src/main/java/io/seata/server/session/SessionHolder.java
@Bughue Bughue changed the title [WIP]optimize : reorganize the usage of task session manager(separate listener and manager) optimize : reorganize the usage of task session manager(separate listener and manager) Jan 31, 2023
@Bughue Bughue changed the base branch from develop to 2.x January 31, 2023 09:19
@funky-eyes funky-eyes added this to the 2.0.0 milestone Jan 31, 2023
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

@Bughue Bughue changed the title optimize : reorganize the usage of task session manager(separate listener and manager) optimize : reorganize the usage of Sessionmanager and listener Feb 1, 2023
@Bughue Bughue changed the title optimize : reorganize the usage of Sessionmanager and listener optimize : reorganize the usage of Sessionmanager and SessionLifecycleListener Feb 1, 2023
@funky-eyes funky-eyes merged commit 25999c3 into apache:2.x Feb 1, 2023
YvCeung pushed a commit to YvCeung/incubator-seata that referenced this pull request Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

task session manager chaos

5 participants