This is an automated email from the ASF dual-hosted git repository.

jianbin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new cec5edfbb2 optimize: avoid dead loop logging during cache plan refresh 
exceptions (#6806)
cec5edfbb2 is described below

commit cec5edfbb2e71520f638a259f4f347c45fea33bc
Author: wuwen <wuwen...@aliyun.com>
AuthorDate: Tue Sep 3 11:40:23 2024 +0800

    optimize: avoid dead loop logging during cache plan refresh exceptions 
(#6806)
---
 changes/en-us/2.x.md                                                    | 1 +
 changes/zh-cn/2.x.md                                                    | 1 +
 .../apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java    | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 5640ab0f5b..8ae906421f 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -77,6 +77,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#6793](https://github.com/apache/incubator-seata/pull/6793)] fix npmjs 
conflicts
 - [[#6793](https://github.com/apache/incubator-seata/pull/6795)] optimize the 
initialization logic for server meta
 - [[#6794](https://github.com/apache/incubator-seata/pull/6794)] optimize 
NacosMockTest UT case
+- [[#6806](https://github.com/apache/incubator-seata/pull/6806)] optimize 
`tableMeta` cache scheduled refresh issue
 
 
 ### refactor:
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index d0840ea38e..d980b6638e 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -78,6 +78,7 @@
 - [[#6793](https://github.com/apache/incubator-seata/pull/6793)] 修复 npmjs 
依赖冲突问题
 - [[#6794](https://github.com/apache/incubator-seata/pull/6794)] 优化 
NacosMockTest 单测问题
 - [[#6793](https://github.com/apache/incubator-seata/pull/6795)] 
独立server的meta信息初始化逻辑
+- [[#6806](https://github.com/apache/incubator-seata/pull/6806)] 
优化`tableMeta`缓存定时刷新问题
 
 
 ### refactor:
diff --git 
a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java
 
b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java
index a49da72fe4..b0048b3259 100644
--- 
a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java
+++ 
b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java
@@ -135,6 +135,8 @@ public class TableMetaCacheFactory {
                         }
                     } catch (Exception exx) {
                         LOGGER.error("table refresh error:{}", 
exx.getMessage(), exx);
+                        // Avoid high CPU usage due to infinite loops caused 
by database exceptions
+                        lastRefreshFinishTime = System.nanoTime();
                     }
                 }
             });


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to