ASF Bugzilla – Attachment 28869 Details for
Bug 53342
If starting immediately after Tomcat stop fail, BindException will throw.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
patch against trunk
patch.txt (text/plain), 1.96 KB, created by
Keiichi Fujino
on 2012-06-01 09:35:36 UTC
(
hide
)
Description:
patch against trunk
Filename:
MIME Type:
Creator:
Keiichi Fujino
Created:
2012-06-01 09:35:36 UTC
Size:
1.96 KB
patch
obsolete
>Index: java/org/apache/catalina/core/ContainerBase.java >=================================================================== >--- java/org/apache/catalina/core/ContainerBase.java (revision 1304135) >+++ java/org/apache/catalina/core/ContainerBase.java (working copy) >@@ -31,8 +31,10 @@ > import java.util.concurrent.Callable; > import java.util.concurrent.Future; > import java.util.concurrent.LinkedBlockingQueue; >+import java.util.concurrent.ThreadFactory; > import java.util.concurrent.ThreadPoolExecutor; > import java.util.concurrent.TimeUnit; >+import java.util.concurrent.atomic.AtomicInteger; > import java.util.concurrent.locks.Lock; > import java.util.concurrent.locks.ReadWriteLock; > import java.util.concurrent.locks.ReentrantReadWriteLock; >@@ -1042,7 +1044,8 @@ > startStopExecutor = new ThreadPoolExecutor( > getStartStopThreadsInternal(), > getStartStopThreadsInternal(), 10, TimeUnit.SECONDS, >- startStopQueue); >+ startStopQueue, >+ new StartStopThreadFactory(getName() + "-startStop-")); > startStopExecutor.allowCoreThreadTimeOut(true); > super.initInternal(); > } >@@ -1596,4 +1599,23 @@ > return null; > } > } >+ >+ private static class StartStopThreadFactory implements ThreadFactory { >+ private ThreadGroup group; >+ private AtomicInteger threadNumber = new AtomicInteger(1); >+ private String namePrefix; >+ >+ public StartStopThreadFactory(String namePrefix) { >+ SecurityManager s = System.getSecurityManager(); >+ group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); >+ this.namePrefix = namePrefix; >+ } >+ >+ @Override >+ public Thread newThread(Runnable r) { >+ Thread thread = new Thread(group, r, namePrefix + threadNumber.getAndIncrement()); >+ thread.setDaemon(true); >+ return thread; >+ } >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 53342
: 28869