----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

At 10:41 AM 3/8/00 +0000, you wrote:
>As a corollary, I've also seen an IndexOutOfBoundsException in 
>LogWriter.Agent,
>as the flush method in there is unsynchronized. In other words, two 
>threads may
>be in the following method at the same time:
>
>public void flush()
>{
>    while(!logQueue.isEmpty())
>    {
>        LogRecord logrecord = (LogRecord)logQueue.get();
>        if(logrecord != null)
>            write(logrecord);
>    }
>}
>
>This clearly causes a problem if two threads get past the !logQueue.isEmpty()
>test when there's only one record left. It also means that logs could end up

I cannot comment on most of your bug report as I've not experienced this 
problem, however I don't think the IndexOutOfBoundsExceptions are being 
caused by an unsynchronized flush method. Although flush() is not 
synchronized, logQueue is a SimpleQueue object who's "get()" method is 
synchronized. Since logQueue.get() returns null on an empty queue, and 
logrecord is checked for a null value bufore writing, there will be no 
attempt write a null logrecord, correct?

I may be wrong - I havn't really delved into the JServ source, but it looks 
like the exception is being caused by something else.

Regards,

Gary Gurevich



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to