areyouok commented on a change in pull request #3458:
URL: https://github.com/apache/rocketmq/pull/3458#discussion_r783712530



##########
File path: 
store/src/main/java/org/apache/rocketmq/store/schedule/ScheduleMessageService.java
##########
@@ -148,7 +167,29 @@ public void run() {
 
     public void shutdown() {
         if (this.started.compareAndSet(true, false) && null != 
this.deliverExecutorService) {
-            this.deliverExecutorService.shutdownNow();
+            this.deliverExecutorService.shutdown();
+            try {
+                
this.deliverExecutorService.awaitTermination(WAIT_FOR_SHUTDOWN, 
TimeUnit.MILLISECONDS);
+            } catch (InterruptedException e) {
+                log.error("deliverExecutorService awaitTermination error", e);
+            }
+
+            if (this.handleExecutorService != null) {
+                this.handleExecutorService.shutdown();
+                try {
+                    
this.handleExecutorService.awaitTermination(WAIT_FOR_SHUTDOWN, 
TimeUnit.MILLISECONDS);
+                } catch (InterruptedException e) {
+                    log.error("handleExecutorService awaitTermination error", 
e);
+                }
+            }
+
+            if (this.deliverPendingTable != null) {
+                for (int i = 1; i <= this.deliverPendingTable.size(); i++) {
+                    log.warn("deliverPendingTable level: {}, size: {}", i, 
this.deliverPendingTable.get(i).size());

Review comment:
       only log this when size()>0 ?




-- 
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]


Reply via email to