4 Replies Latest reply: May 14, 2012 12:19 PM by Galder Zamarreño RSS

Broken pipe exception when reading from remote cache.

venkataratnam teki Newbie

Hi,

 

I have started Infinispan hotrod server on a unix server.

 

I am facing an error when i am reading from another machine.. The code snippet used is below.

 

RemoteCacheManager rcm = new RemoteCacheManager("<serverip>:11224");

RemoteCache<String, String> rc = rcm.getCache("books");

 

And, this is my namedcache configuration...

 

<namedCache name="books">

                <eviction wakeUpInterval="5000" maxEntries="10000" strategy="LRU" />

                <expiration maxIdle="50000" lifespan="50000"

                        wakeUpInterval="5000" />

                 <loaders passivation="false" shared="false" preload="true">

                        <loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true"

                        ignoreModifications="false" purgeOnStartup="false">

                                <properties>

                                        <property name="location" value="BookStore-11224" />

                                </properties>

                        </loader>

                </loaders>

        </namedCache>

 

 

2012-05-11 15:08:20,483 ERROR [HotRodDecoder] (HotRodServerWorker-1-1) ISPN005009: Unexpected error before any request parameters read

java.io.IOException: Connection reset by peer

        at sun.nio.ch.FileDispatcher.read0(Native Method)

        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)

        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:202)

        at sun.nio.ch.IOUtil.read(IOUtil.java:169)

        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:243)

        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:323)

        at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:282)

        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:202)

        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)

2012-05-11 15:08:20,486 ERROR [HotRodDecoder] (HotRodServerWorker-1-1) ISPN005009: Unexpected error before any request parameters read

java.io.IOException: Broken pipe

        at sun.nio.ch.FileDispatcher.write0(Native Method)

        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)

        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:72)

        at sun.nio.ch.IOUtil.write(IOUtil.java:28)

        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)

        at org.jboss.netty.channel.socket.nio.SocketSendBufferPool$PooledSendBuffer.transferTo(SocketSendBufferPool.java:240)

        at org.jboss.netty.channel.socket.nio.NioWorker.write0(NioWorker.java:472)

        at org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:390)

        at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:137)

        at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:76)

        at org.jboss.netty.channel.Channels.write(Channels.java:632)

        at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70)

        at org.jboss.netty.channel.Channels.write(Channels.java:611)

        at org.jboss.netty.channel.Channels.write(Channels.java:578)

        at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:251)

        at org.infinispan.server.core.AbstractProtocolDecoder.exceptionCaught(AbstractProtocolDecoder.scala:279)

        at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:432)

        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:333)

        at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:282)

        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:202)

        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)

 

 

Can anyone please help me out...

  • 1. Re: Broken pipe exception when reading from remote cache.
    venkataratnam teki Newbie

    A small edit,

     

    this stack trace is coming, when i stop the remote cache . And, this exception is being thrown, even though i commented out loaders tag..

  • 2. Re: Broken pipe exception when reading from remote cache.
    Galder Zamarreño Master

    Seems like you stopped the remote cache or remote client while it was sending requests? The server is trying to read the requests but you've closed the client sockets.

  • 3. Re: Broken pipe exception when reading from remote cache.
    venkataratnam teki Newbie

    I wrote just 10 key value pairs to my remote hotrod server using my java program..

    key is of string type and value is also of type string type..

     

    As soon as writing, i did remoteCache.get() for those 10keys.. and after reading only, i have stopped the remote cache after a considerable time..10minutes.....

     

    But, even then, i am getting exception at my remote servers.

     

    2012-05-14 12:31:38,256 ERROR [HotRodDecoder] (HotRodServerWorker-1-2) ISPN005009: Unexpected error before any request parameters read

    java.io.IOException: Connection reset by peer

            at sun.nio.ch.FileDispatcher.read0(Native Method)

            at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)

            at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:202)

            at sun.nio.ch.IOUtil.read(IOUtil.java:169)

            at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:243)

            at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:323)

            at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:282)

            at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:202)

            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)

    2012-05-14 12:31:38,258 ERROR [HotRodDecoder] (HotRodServerWorker-1-2) ISPN005009: Unexpected error before any request parameters read

    java.io.IOException: Broken pipe

            at sun.nio.ch.FileDispatcher.write0(Native Method)

            at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)

            at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:72)

            at sun.nio.ch.IOUtil.write(IOUtil.java:28)

            at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)

            at org.jboss.netty.channel.socket.nio.SocketSendBufferPool$PooledSendBuffer.transferTo(SocketSendBufferPool.java:240)

            at org.jboss.netty.channel.socket.nio.NioWorker.write0(NioWorker.java:472)

            at org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:390)

            at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:137)

            at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:76)

            at org.jboss.netty.channel.Channels.write(Channels.java:632)

            at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70)

            at org.jboss.netty.channel.Channels.write(Channels.java:611)

            at org.jboss.netty.channel.Channels.write(Channels.java:578)

            at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:251)

            at org.infinispan.server.core.AbstractProtocolDecoder.exceptionCaught(AbstractProtocolDecoder.scala:279)

            at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:432)

            at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:333)

            at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:282)

            at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:202)

            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)

     

     

    I am wondering, why the remote cache server must be communicating even after reading the entries..(please note that, i did not configure the cache store also).

  • 4. Re: Broken pipe exception when reading from remote cache.
    Galder Zamarreño Master

    Hmmm, weird. Maybe the Hot Rod client is doing some periodic ping or has some keep-alive logic, and that's the result of closing down the client while such a message is being written. I don't recall of the top of my head.

     

    Repeat the test after enabling TRACE logging on org.infinispan package in both the client and the server, and then attach a zip with those files. We'll then be able to have a look at what is going on.