Unfortunately something weird happened with your replay for Trustin
answer. In your message source I see that all lines is preceded by '> '
char. So I afaraid that community can overlook it.
Regards, Marcin
Haviv wrote:
There is synch parts on the ExecutorFilter.fireEvent :
synchronized( buf.eventQueue )
{
buf.eventQueue.add( event );
if( buf.processingCompleted )
{
buf.processingCompleted = false;
if ( logger.isDebugEnabled() ) {
logger.debug( "Launching thread for " +
session.getRemoteAddress() );
}
executor.execute( new ProcessEventsRunnable( buf ) );
}
}
But this method just puts the Runnable on a Q, and the
CumulativeProtocolDecoder runs on a different thread.
There is another synch block in ProcessEventsRunnable:
public void run()
{
while( true )
{
Event event;
synchronized( buffer.eventQueue )
{
if( buffer.eventQueue.isEmpty() )
{
buffer.processingCompleted = true;
break;
}
event = ( Event ) buffer.eventQueue.remove( 0 );
}
processEvent( event.getNextFilter(), buffer.session,
event.getType(), event.getData() );
}
if ( logger.isDebugEnabled() ) {
logger.debug( "Exiting since queue is empty for " +
buffer.session.getRemoteAddress() );
}
}
But as you can see the processEvent is actually outside of the block.
- Re: CumulativeProtocolDecoder BUG ? Marcin Waldowski
-