You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "YongGoose (via GitHub)" <gi...@apache.org> on 2025/08/04 02:09:11 UTC

Re: [PR] Add Public API to Clear All `TableMetaRefreshHolder` Instances [incubator-seata]

YongGoose commented on code in PR #7559:
URL: https://github.com/apache/incubator-seata/pull/7559#discussion_r2250264685


##########
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:
   > Is it possible for us to use the publish-subscribe pattern, so that after the rm close message is published, TableMetaCache proceeds to shut down?
   
   <img width="542" height="620" alt="event" src="https://github.com/user-attachments/assets/6cac6161-8f56-42b8-af05-233af765d41c" />
   
   Something like this could work.
   
   However, compared to explicitly calling the `shutdown API` when the `RM` is `destroyed`, I don’t see a significant advantage.
   
   If we go with the approach where `TableMetaCacheFactory` implements a `listener`, we could consider making shutdown a `private API`.
   
   What do you think?



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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