aooohan opened a new pull request, #515:
URL: https://github.com/apache/tomcat/pull/515

   # Reproduce
   ```xml
   <Engine name="Catalina" defaultHost="localhost"  startStopThreads="3">
         <Host name="localhost"  appBase="webapps"
               unpackWARs="true" autoDeploy="true" startStopThreads="4">
         </Host>
   </Engine>
   ```
   **When starting tomcat as configured above, the situation shown in the image 
below will occur.**
   
   <img width="1669" alt="image" 
src="https://user-images.githubusercontent.com/40265686/169047128-b7fefd31-7a1a-4ba4-96e7-05dfbd2156dc.png";>
   
   **been stuck here**⬆️⬆️⬆️
   
   **Then  i used the Arthas tool to look at the threads and the results are 
shown below.**
   
   <img width="1709" alt="image" 
src="https://user-images.githubusercontent.com/40265686/169047640-8c2d689d-3e23-49c4-861b-b1c5a4d6ce3e.png";>
   <img width="1350" alt="image" 
src="https://user-images.githubusercontent.com/40265686/169047710-d9d8e8a9-c2f0-41ff-92dc-148d9d99a52c.png";>
   <img width="1509" alt="image" 
src="https://user-images.githubusercontent.com/40265686/169048027-9b1c1e43-8ccc-4782-b9ed-cbf2d518dcf6.png";>
   
   
   
    When starting tomcat, the current StandardServer instance object has been 
locked in LifecycleBase#start. When we do not set the startStopThreads value of 
StandardEngine, startStopThreads defaults to 1. At this time, startStopExecutor 
in StandardEngine is actually an instance of InlineExecutorService (in fact, 
the current thread), so when StandardEngine starts its subcontainer 
StandardHost through the startStopExecutor thread pool, because it is the 
current thread, there is no problem when executing the 
.StandardServer#reconfigureUtilityExecutor method.
   However, when the startStopExecutor in StandardEngine is not 
InlineExecutorService (ie Server#getUtilityExecutor()), the 
StandardServer#reconfigureUtilityExecutor method is executed again(The host's 
startStopThreads value is greater than the engine's startStopThreads), because 
the lock of the StandardServer instance has not been released at this time, 
resulting in a deadlock.
   
   
   > My English is limited, I don't know if I have explained it clearly, or I 
am thinking in the wrong direction
   
   
   
   


-- 
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: dev-unsubscr...@tomcat.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to