[infinispan-issues] [JBoss JIRA] (ISPN-2550) NoSuchElementException in Hot Rod Encoder

Michal Linhard (JIRA) jira-events at lists.jboss.org
Tue Dec 11 05:39:17 EST 2012


    [ https://issues.jboss.org/browse/ISPN-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740544#comment-12740544 ] 

Michal Linhard commented on ISPN-2550:
--------------------------------------

I've run tests locally with dan's fix and I'm seeing these exceptions:
{code}
11:19:23,919 ERROR [org.infinispan.server.hotrod.HotRodDecoder] (HotRodClientMaster-5) ISPN005009: Unexpected error before any request parameters read
java.lang.IndexOutOfBoundsException: 2
	at scala.collection.mutable.ResizableArray$class.apply(ResizableArray.scala:44)
	at scala.collection.mutable.ArrayBuffer.apply(ArrayBuffer.scala:47)
	at org.infinispan.server.hotrod.AbstractTopologyAwareEncoder1x$$anonfun$writeHashTopologyHeader$1$$anonfun$apply$mcVI$sp$1.apply(AbstractTopologyAwareEncoder1x.scala:96)
	at org.infinispan.server.hotrod.AbstractTopologyAwareEncoder1x$$anonfun$writeHashTopologyHeader$1$$anonfun$apply$mcVI$sp$1.apply(AbstractTopologyAwareEncoder1x.scala:92)
	at scala.collection.immutable.Range.foreach(Range.scala:81)
	at org.infinispan.server.hotrod.AbstractTopologyAwareEncoder1x$$anonfun$writeHashTopologyHeader$1.apply$mcVI$sp(AbstractTopologyAwareEncoder1x.scala:92)
	at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:78)
	at org.infinispan.server.hotrod.AbstractTopologyAwareEncoder1x.writeHashTopologyHeader(AbstractTopologyAwareEncoder1x.scala:89)
	at org.infinispan.server.hotrod.AbstractEncoder1x.writeHeader(AbstractEncoder1x.scala:62)
	at org.infinispan.server.hotrod.HotRodEncoder.encode(HotRodEncoder.scala:63)
	at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:67)
	at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60)
	at org.jboss.netty.channel.Channels.write(Channels.java:712)
	at org.jboss.netty.channel.Channels.write(Channels.java:679)
	at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248)
	at org.infinispan.server.core.AbstractProtocolDecoder.exceptionCaught(AbstractProtocolDecoder.scala:295)
	at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:533)
	at org.jboss.netty.channel.AbstractChannelSink.exceptionCaught(AbstractChannelSink.java:49)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
	at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:84)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:472)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:333)
	at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
{code}
                
> NoSuchElementException in Hot Rod Encoder
> -----------------------------------------
>
>                 Key: ISPN-2550
>                 URL: https://issues.jboss.org/browse/ISPN-2550
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Remote protocols
>    Affects Versions: 5.2.0.Beta4
>            Reporter: Michal Linhard
>            Assignee: Galder Zamarreño
>            Priority: Blocker
>             Fix For: 5.2.0.Beta6
>
>
> Tomas noticed this a while ago in a specific functional test:
> https://bugzilla.redhat.com/show_bug.cgi?id=875151
> I'm creating a more general JIRA, cause I'm having this in resilience test.
> What I found by quick debug, is that here:
> https://github.com/infinispan/infinispan/blob/master/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Encoders.scala#L106
> {code}
>                for (segmentIdx <- 0 until numSegments) {
>                   val denormalizedSegmentHashIds = allDenormalizedHashIds(segmentIdx)
>                   val segmentOwners = ch.locateOwnersForSegment(segmentIdx)
>                   for (ownerIdx <- 0 until segmentOwners.length) {
>                      val address = segmentOwners(ownerIdx % segmentOwners.size)
>                      val serverAddress = members(address)
>                      val hashId = denormalizedSegmentHashIds(ownerIdx)
>                      log.tracef("Writing hash id %d for %s:%s", hashId, serverAddress.host, serverAddress.port)
>                      writeString(serverAddress.host, buf)
>                      writeUnsignedShort(serverAddress.port, buf)
>                      buf.writeInt(hashId)
>                   }
>                }
> {code}
> we're trying to obtain serverAddress for nonexistent address and NoSuchElementException is not handled properly.
> It hapens after I kill a node in a resilience test and the exception appears when querying for the node in the members cache.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the infinispan-issues mailing list