diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index 5640ab0f5b5..8ae906421f0 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 d0840ea38ef..d980b6638e2 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 a49da72fe4f..b0048b32596 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 @@ static class TableMetaRefreshHolder { } } 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(); } } });