funky-eyes commented on code in PR #7559:
URL: https://github.com/apache/incubator-seata/pull/7559#discussion_r2253231740


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java:
##########
@@ -108,7 +108,19 @@ private static void removeHolderFromMap(String resourceId) 
{
         LOGGER.info("Removed TableMetaRefreshHolder for resourceId: {}", 
resourceId);
     }
 
+    /**
+     * Shutdown all TableMetaRefreshHolder threads.
+     */
+    public static void shutdown() {

Review Comment:
   When registering itself with the Seata-Server (TC), I believe that 
`DataSourceProxy` should proxy the `close` method. Upon closing, it should 
remove itself from both `DefaultResourceManager` and `TableMetaCacheFactory`. 
Currently, `TableMetaCacheFactory#removeHolderFromMap` is executed 
passively—only when refreshing table metadata encounters an exception due to a 
closed datasource does the removal occur. This approach, however, feels 
inelegant.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to