Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/en-us/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The version is updated as follows:
- [[#5523](https://github.com/seata/seata/pull/5523)] fix GlobalStatus=9 can't be cleared in DB storage mode
- [[#5558](https://github.com/seata/seata/pull/5558)] fix mariadb rollback failed
- [[#5556](https://github.com/seata/seata/pull/5556)] fix oracle insert undolog failed
- [[#5577](https://github.com/seata/seata/pull/5577)] fix grpc interceptor xid unbinding problem

### optimize:
- [[#5208](https://github.com/seata/seata/pull/5208)] optimize throwable getCause once more
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#5523](https://github.com/seata/seata/pull/5523)] 修复 GlobalStatus=9 在DB存储模式无法清除的问题
- [[#5558](https://github.com/seata/seata/pull/5558)] 修复mariadb回滚失败的问题
- [[#5556](https://github.com/seata/seata/pull/5556)] 修复 oracle 插入 undolog 失败问题
- [[#5577](https://github.com/seata/seata/pull/5577)] 修复 grpc拦截器解绑xid失败问题

### optimize:
- [[#5208](https://github.com/seata/seata/pull/5208)] 优化多次重复获取Throwable#getCause问题
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void onMessage(ReqT message) {

@Override
public void onHalfClose() {
cleanContext();
if (StringUtils.isNotBlank(xid)) {
RootContext.bind(xid);
String branchType = context.get(RootContext.KEY_BRANCH_TYPE);
Expand All @@ -63,13 +64,11 @@ public void onHalfClose() {

@Override
public void onCancel() {
cleanContext();
target.onCancel();
}

@Override
public void onComplete() {
cleanContext();
target.onComplete();
}

Expand All @@ -79,20 +78,10 @@ public void onReady() {
}

private void cleanContext() {
if (StringUtils.isNotBlank(xid) && RootContext.inGlobalTransaction()) {
String unbindXid = RootContext.unbind();
BranchType previousBranchType = RootContext.getBranchType();
if (BranchType.TCC == previousBranchType) {
RootContext.unbindBranchType();
}
if (!xid.equalsIgnoreCase(unbindXid)) {
RootContext.bind(unbindXid);
LOGGER.warn("bind xid [{}] back to RootContext", unbindXid);
if (BranchType.TCC == previousBranchType) {
RootContext.bindBranchType(previousBranchType);
LOGGER.warn("bind branchType [{}] back to RootContext", previousBranchType);
}
}
RootContext.unbind();
BranchType previousBranchType = RootContext.getBranchType();
if (BranchType.TCC == previousBranchType) {
RootContext.unbindBranchType();
}
}
}