Blocked in StdServerSession.start: PooledExecutor has no thr
thoennes Feb 19, 2004 8:59 AMHi,
we have seen a related post recently in this forum, where genman analyzed the situation and
added a fix in the HEAD of Branch_3_2:
revision 1.14.2.3
date: 2004/01/13 19:21:25; author: genman; state: Exp; lines: +21 -1
Throwable / Thread.interrupted must be caught/checked otherwise we lose JMS
ServerSession threads through PooledExecutor
(Looking at the sources, this sort of safety checking is done elsewhere.)
This is a fix for a "forum bug"
http://jboss.org/index.html?module=bb&op=viewtopic&p=3818218#3818218
The forum entry disappeared and therefore we created a new topic.
Our MDB is configured as a singleton (MaximumSize=1), so that the PooledExecutor
gets configured as follows:
executor = new PooledExecutor(poolSize); // poolSize = 1 executor.setMinimumPoolSize(0); executor.setKeepAliveTime(1000 * 30); executor.waitWhenBlocked(); executor.setThreadFactory(new DefaultThreadFactory());
If the only thread in this thread pool dies, the mininmum size of 0 prevents the generation of new threads. In an e-mail discussion Doug Lea (creator of the util.concurrent package) explained why the thread should die rather than catch any exception:
Yes, this is a documented feature, not a bug. Threads dying from
uncaught exceptions are discarded because you cannot tell if they are
in usable states.
I believe that the unexpected consequence of this in your case is that
it will only replace such threads with new ones if there are fewer
than the minimum number of threads. (See method workerDone()). If you
would like them replaced in such cases, you could increase the minimum
value.
So we think that minimum size of the thread pool should be 1 (as in the other two thread pools in the OIL2 and UIL2). Doug said about the above configuration:
I have mentioned several times to people using JBoss that setting a
minimum size of zero is usually a bad idea because it interacts badly
with other policies and settings. It cannot be disallowed, because
there ARE legitimate uses for this, but they are not common.
IMHO, genman should also review his change to catch the Throwable: Log the exception/error thrown and let the thread die. The PooledExecutor will create a new one if needed.
Is it possible to build a separate org.jboss.jms.asf package jar which contains the above fixes and can be added to the current 3.2.3 release?
Thanks in advance and regards
Joerg