Multiple worker threads and replaying decoder impl issues

Galder Zamarreno galder at jboss.org
Tue Apr 6 11:09:23 EDT 2010


Hi,

I've created a decoder based on the ReplayingDecoder and I'm seeing some  
funny issues happening when the number of worker threads is more than one.

For example, the buffer passed on the decode() call-back come sometimes be  
null.

010-04-06 16:59:53,644 ERROR [AbstractProtocolDecoder$] (New I/O server  
worker #1-4) Exception reported
java.lang.RuntimeException: Buffer is null, how can it be???
	at scala.Predef$.error(Predef.scala:74)
	at  
org.infinispan.server.core.transport.netty.DecoderAdapter.decode(DecoderAdapter.scala:18)
	at  
org.infinispan.server.core.transport.netty.DecoderAdapter.decode(DecoderAdapter.scala:13)
	at  
org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:461)

On top of that, we're seeing issues where thread-1 starts reading the  
request and then waits for more bytes to come but when these bytes come  
in, they're read by thread-2 which does not know what thread-1 read and  
fails since it expects the start of a request.

So, is worker threads being single thread the only option here? What else  
do you suggest? We currently use no state management. Would adding it  
solve these issues?

Cheers,
-- 
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache



More information about the netty-users mailing list