Kris20030907 commented on issue #10023:
URL: https://github.com/apache/rocketmq/issues/10023#issuecomment-3764853309

   This repeated call will not cause an exception to be thrown, because 
ThreadPoolExecutor treats repeated calls to shutdown idempotently. However, 
this is still a code defect, so I submitted a fix.
   
   ```java
   public void shutdown() {
           final ReentrantLock mainLock = this.mainLock;
           mainLock.lock();
           try {
               checkShutdownAccess();
               advanceRunState(SHUTDOWN);
               interruptIdleWorkers();
               onShutdown(); // hook for ScheduledThreadPoolExecutor
           } finally {
               mainLock.unlock();
           }
           tryTerminate();
       }
   ```


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