[jboss-dev] org.jboss.util.threadpool.BasicThreadPool issue

Adrian abrock at redhat.com
Tue Sep 11 11:24:02 EDT 2007


I'm not making use of anything, Scott wrote this code. :-)

The issue looks to be related to the conversion
of the code from using Heap (which returns null when empty)
to PriorityQueue.
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/common/common-core/trunk/src/main/java/org/jboss/util/threadpool/BasicThreadPool.java?view=diff&r1=2390&r2=2391

Contrary to your comment, PriorityQueue throws an Exception 
when empty on the remove() as opposed to remove(Object):
http://java.sun.com/j2se/1.5.0/docs/api/java/util/AbstractQueue.html#remove()

A simple check for isEmpty() and return null
(assuming the code is already thread safe) should stop the logging?

On Tue, 2007-09-11 at 09:57 -0500, Anil Saldhana wrote:
> Adrian,
>     with some progressive changes in my AS5 trunk workspace, while 
> running one of the tests in the test suite, the server log is filling up 
> with the following exception (it is reaching something like 800MB in log 
> size)
> =================
> 2007-09-11 09:40:10,843 DEBUG 
> [org.jboss.util.threadpool.BasicThreadPool] Timeou
> t monitor saw unexpected error
> java.util.NoSuchElementException
>         at java.util.AbstractQueue.remove(AbstractQueue.java:80)
>         at 
> org.jboss.util.threadpool.BasicThreadPool.getNextTimeout(BasicThreadPool.java:475)
>         at 
> org.jboss.util.threadpool.BasicThreadPool$TimeoutMonitor.run(BasicThreadPool.java:593)
>         at java.lang.Thread.run(Thread.java:595)
> 
> =====================
> 
> I am still checking why this issue is happening.  But I see that you are 
> making use of a PriorityQueue and whose remove is supposed to be safe 
> from any exception.
> 
> Regards,
> Anil
> 
> 
> _______________________________________________
> jboss-development mailing list
> jboss-development at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-development
-- 
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx




More information about the jboss-development mailing list