You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/03/08 11:15:36 UTC

[GitHub] [shardingsphere] terrymanu commented on a change in pull request #15868: Make ExecutorServiceManager could be AutoCloseable ( remove the ShutdownHook)

terrymanu commented on a change in pull request #15868:
URL: https://github.com/apache/shardingsphere/pull/15868#discussion_r821564868



##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/executor/UserExecutorGroup.java
##########
@@ -46,4 +48,21 @@ private UserExecutorGroup() {
     public static UserExecutorGroup getInstance() {
         return INSTANCE;
     }
+    
+    /**
+     * Close executor service.
+     */
+    @Override
+    public void close() {
+        if (null != executorService) {
+            try {
+                executorService.shutdown();
+                while (!executorService.awaitTermination(5, TimeUnit.SECONDS)) {
+                    executorService.shutdownNow();
+                }
+            } catch (final InterruptedException ex) {
+                Thread.currentThread().interrupt();
+            }
+        }

Review comment:
       UserExecutorGroup is for proxy only, spring boot maybe not need change




-- 
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@shardingsphere.apache.org

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