Skip to content
Snippets Groups Projects
Unverified Commit efefd177 authored by Dmego's avatar Dmego Committed by GitHub
Browse files

bugfix: set time threshold for transactions in committing state (#3560)

parent 88d938a2
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,8 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#3481](https://github.com/seata/seata/pull/3481)] 修复当 consul client 获取集群信息报错时会导致刷新任务中断
- [[#3491](https://github.com/seata/seata/pull/3491)] 修复README.md文件中的拼写错误
- [[#3531](https://github.com/seata/seata/pull/3531)] 修复RedisTransactionStoreManager读取brachTransaction中的NPE
- [[#3500](https://github.com/seata/seata/pull/3500)] 修复 oracle 和 postgreSql 不能查询出 column info 的问题
- [[#3560](https://github.com/seata/seata/pull/3560)] 修复 Committing 状态的事务没有时间阈值问题
- [[#3555](https://github.com/seata/seata/pull/3555)] 通过setBytes代替setBlob,避免高版本jdbc驱动工作异常
- [[#3540](https://github.com/seata/seata/pull/3540)] 修复server发布打包时缺失文件
......@@ -106,6 +108,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [github-ganyu](https://github.com/github-ganyu)
- [xuande](https://github.com/xuande)
- [tanggen](https://github.com/tanggen)
- [dmego](https://github.com/dmego)
同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
......
......@@ -44,6 +44,8 @@
- [[#3481](https://github.com/seata/seata/pull/3481)] fix seata node refresh failure because consul crash
- [[#3491](https://github.com/seata/seata/pull/3491)] fix typo in README.md
- [[#3531](https://github.com/seata/seata/pull/3531)] fix the NPE of RedisTransactionStoreManager when get branch transactions
- [[#3500](https://github.com/seata/seata/pull/3500)] fix oracle and postgreSQL can't query column info
- [[#3560](https://github.com/seata/seata/pull/3560)] set time threshold for transactions in committing state
- [[#3555](https://github.com/seata/seata/pull/3555)] do not call setBlob to invalid the jdbc exception
- [[#3540](https://github.com/seata/seata/pull/3540)] fix server distribution missing files
......@@ -110,6 +112,7 @@
- [github-ganyu](https://github.com/github-ganyu)
- [xuande](https://github.com/xuande)
- [tanggen](https://github.com/tanggen)
- [dmego](https://github.com/dmego)
Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
......
......@@ -281,7 +281,7 @@ public class DefaultCoordinator extends AbstractTCInboundHandler implements Tran
SessionHelper.forEach(rollbackingSessions, rollbackingSession -> {
try {
// prevent repeated rollback
if (rollbackingSession.getStatus().equals(GlobalStatus.Rollbacking) && !rollbackingSession.isRollbackingDead()) {
if (rollbackingSession.getStatus().equals(GlobalStatus.Rollbacking) && !rollbackingSession.isDeadSession()) {
//The function of this 'return' is 'continue'.
return;
}
......@@ -316,6 +316,11 @@ public class DefaultCoordinator extends AbstractTCInboundHandler implements Tran
long now = System.currentTimeMillis();
SessionHelper.forEach(committingSessions, committingSession -> {
try {
// prevent repeated commit
if (committingSession.getStatus().equals(GlobalStatus.Committing) && !committingSession.isDeadSession()) {
//The function of this 'return' is 'continue'.
return;
}
if (isRetryTimeout(now, MAX_COMMIT_RETRY_TIMEOUT.toMillis(), committingSession.getBeginTime())) {
/**
* Prevent thread safety issues
......
......@@ -157,10 +157,10 @@ public class GlobalSession implements SessionLifecycle, SessionStorable {
}
/**
* prevent could not handle rollbacking transaction
* @return if true force roll back
* prevent could not handle committing and rollbacking transaction
* @return if true retry commit or roll back
*/
public boolean isRollbackingDead() {
public boolean isDeadSession() {
return (System.currentTimeMillis() - beginTime) > (2 * 6000);
}
......
......@@ -168,7 +168,7 @@ public class DataBaseSessionManager extends AbstractSessionManager
if (SessionHolder.ASYNC_COMMITTING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) {
return findGlobalSessions(new SessionCondition(GlobalStatus.AsyncCommitting));
} else if (SessionHolder.RETRY_COMMITTING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) {
return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.CommitRetrying}));
return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.CommitRetrying, GlobalStatus.Committing}));
} else if (SessionHolder.RETRY_ROLLBACKING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) {
return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.RollbackRetrying,
GlobalStatus.Rollbacking, GlobalStatus.TimeoutRollbacking, GlobalStatus.TimeoutRollbackRetrying}));
......
......@@ -166,7 +166,7 @@ public class RedisSessionManager extends AbstractSessionManager
if (SessionHolder.ASYNC_COMMITTING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) {
return findGlobalSessions(new SessionCondition(GlobalStatus.AsyncCommitting));
} else if (SessionHolder.RETRY_COMMITTING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) {
return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.CommitRetrying}));
return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.CommitRetrying, GlobalStatus.Committing}));
} else if (SessionHolder.RETRY_ROLLBACKING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) {
return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.RollbackRetrying,
GlobalStatus.Rollbacking, GlobalStatus.TimeoutRollbacking, GlobalStatus.TimeoutRollbackRetrying}));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment