Bug 53342 - If starting immediately after Tomcat stop fail, BindException will throw.
Summary: If starting immediately after Tomcat stop fail, BindException will throw.
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: trunk
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-01 09:34 UTC by Keiichi Fujino
Modified: 2012-06-01 09:49 UTC (History)
0 users



Attachments
patch against trunk (1.96 KB, text/plain)
2012-06-01 09:35 UTC, Keiichi Fujino
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Keiichi Fujino 2012-06-01 09:34:18 UTC
e.g.
When Context#stop throw LifecycleException, the main thread stops, 
but startStopThreads of Host/Engine will remain for a while. 
Because, startStopThreads is not a demon thread. 

As a result, 
even if a main thread stops, Acceptor Threads of 8080/8009 is not stopped. 

keepAliveTime for 10 seconds is set up now. 
===
startStopExecutor = new ThreadPoolExecutor(
            getStartStopThreadsInternal(),
            getStartStopThreadsInternal(), 10, TimeUnit.SECONDS,
            startStopQueue);
===

Therefore, in order to avoid BindException, the waiting for 10 seconds is required. 

I think that I need to make startStopThreads into a demon thread. 

Best Regards.
Comment 1 Keiichi Fujino 2012-06-01 09:35:36 UTC
Created attachment 28869 [details]
patch against trunk
Comment 2 Keiichi Fujino 2012-06-01 09:49:31 UTC
Fixed in trunk and 7.0.x. Will be in 7.0.28.