8 Replies Latest reply on Jun 8, 2010 3:22 AM by mircea.markus

    hotrod

    jia

      I am playing with hotrod. I am using Beta1. I started server using -r hotrod -c Myconfigurationfile. The server started fine, it seems it creating a Cache I am expecting. Then I started my client. Mclient starts fine, I can put in entries and retrieve them. But after a while, I will receive following exception:

       

       

      Exception in thread "main" org.infinispan.client.hotrod.exceptions.TransportException: Problems writing data to stream
              at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.writeByte(TcpTransport.java:101)
              at org.infinispan.client.hotrod.impl.HotrodOperationsImpl.writeHeader(HotrodOperationsImpl.java:277)
              at org.infinispan.client.hotrod.impl.HotrodOperationsImpl.sendKeyOperation(HotrodOperationsImpl.java:418)
              at org.infinispan.client.hotrod.impl.HotrodOperationsImpl.get(HotrodOperationsImpl.java:45)
              at org.infinispan.client.hotrod.impl.RemoteCacheImpl.get(RemoteCacheImpl.java:249)
              at com.cboe.infinispan.hotrodclient.MyHotRodClient.getEntry(MyHotRodClient.java:252)
              at com.cboe.infinispan.hotrodclient.MyHotRodClient.main(MyHotRodClient.java:129)
      Caused by: 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:104)
              at sun.nio.ch.IOUtil.write(IOUtil.java:75)
              at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
              at java.nio.channels.Channels.write(Channels.java:60)
              at java.nio.channels.Channels.access$000(Channels.java:47)
              at java.nio.channels.Channels$1.write(Channels.java:134)
              at java.io.OutputStream.write(OutputStream.java:58)
              at java.nio.channels.Channels$1.write(Channels.java:115)
              at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.writeByte(TcpTransport.java:96)

      Would anybody please shed some light on this?

       

      Thanks,

       

      Jessica

        • 1. Re: hotrod
          galder.zamarreno

          Hmmmm, not sure about the cause of this. Did the server show any errors in its log?

           

          Are there any firewalls between client and server?

           

          One theory might be that the idle timeout kicked in and the connection was closed (see http://community.jboss.org/docs/DOC-15093 for info on idle timeout). Try passing -i 0 to the server to disable timeout and see if that works.

          • 2. Re: hotrod
            mircea.markus

            Looks like the connection timeouts after a while and a call is being affected by this.

            A solution for this will be included in 4.1.Cr1:  ISPN-441

            I've also added another JIRA to further detail on how to avoid this: https://jira.jboss.org/browse/ISPN-457

            • 3. Re: hotrod
              jia

              Galder,

               

                 Thanks for the reply. Surprisingly there is no .log file created, but on the window I started server, I got 

              May 25, 2010 9:31:14 AM org.infinispan.util.logging.AbstractLogImpl info
              INFO: Start main with args: -r, hotrod, -c, /home/jia/infinispan-4.1.0.BETA1/etc/config-samples/proto-r-t.xml
              May 25, 2010 9:31:15 AM org.infinispan.remoting.transport.jgroups.JGroupsTransport start
              INFO: Starting JGroups Channel
              May 25, 2010 9:31:15 AM org.jgroups.logging.JDKLogImpl info
              INFO: JGroups version: 2.10.0.Beta2

              -------------------------------------------------------------------
              GMS: address=ccserv3-25167, cluster=demoCluster, physical address=170.137.230.104:7800
              -------------------------------------------------------------------
              May 25, 2010 9:31:18 AM org.infinispan.util.logging.AbstractLogImpl info
              INFO: Received new cluster view: [ccserv3-25167|0] [ccserv3-25167]
              May 25, 2010 9:31:18 AM org.infinispan.util.logging.AbstractLogImpl info
              INFO: Cache local address is ccserv3-25167, physical addresses are [170.137.230.104:7800]
              May 25, 2010 9:31:18 AM org.infinispan.factories.AbstractComponentRegistry internalStart
              INFO: Infinispan version: Infinispan 'Radegast' 4.1.0.BETA1
              May 25, 2010 9:31:19 AM org.infinispan.factories.AbstractComponentRegistry internalStart
              INFO: Infinispan version: Infinispan 'Radegast' 4.1.0.BETA1
              May 25, 2010 9:31:19 AM org.infinispan.factories.AbstractComponentRegistry internalStart
              INFO: Infinispan version: Infinispan 'Radegast' 4.1.0.BETA1

               

              Which makes me think the server satrted OK. Also when I started client, client could put entries and get entries, even I kill the current client, and start another one, the new client still can get the entry without putting any in, which makes me think the client and server are having connection as I expect.

               

              I tried -i options, even though the help say it should take -i, but in the server code, it does not, I checked server code in BETA1.

               

              Any other possibilities?

              • 4. Re: hotrod
                jia

                Mircea,

                 

                   Thanks for the reply. I click on  ISPN-441, it doe snot exist. Could you please check what happened to it? So it seems some fix is in 4.1.0 CR1 for BETA1, how do I get the fix?

                 

                Thanks,

                 

                Jessica

                • 5. Re: hotrod
                  meetoblivion

                  I ran into the same issue.  If you start the cache server with --idle_timeout=0 the problem will go away.

                  • 6. Re: hotrod
                    jia

                    Just got  a chance to try this. John, you are right, long option --idle_timeout 0 works, short option -i 0 does not work, that is the case in the source code. If the author want to fix it, it is server/core Main.scala file, where short option only has var sopts = "-:hD:Vp:l:m:t:c:r:", i should be added in there.

                     

                    Thanks guys,

                     

                    Jessica

                    • 7. Re: hotrod
                      galder.zamarreno

                      Thanks Jessica. I fixed that as part of https://jira.jboss.org/browse/ISPN-443 and hence it's included in BETA2.

                       

                      By the way, I changed the default idle timeout to be -1 which means that is disabled (setting it to 0 also disables it). See https://jira.jboss.org/browse/ISPN-461

                      • 8. Re: hotrod
                        mircea.markus

                        As with ISPN-441 the hotrod client can be customised to drop idle connections. See the "bellow is connection pooling config"  paragraph in the RemoteCacheManager's javadoc.