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: [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