4 Replies Latest reply on Mar 16, 2012 1:59 PM by 923940

    CORBA CLIENT - SocketTimeoutException

      Hi all,

      I have a Corba client application using a connection timeout of 15 seconds and few times per day, a strange situation used to occurs. The client throws a java.net.SocketTimeoutException after less than 1 second of the request.

      The complete stack trace is:

      org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe
      at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectionAbort(ORBUtilSystemException.java:2372)
      at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectionAbort(ORBUtilSystemException.java:2390)
      at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.readBits(SocketOrChannelConnectionImpl.java:354)
      at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:289)
      at com.sun.corba.se.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:80)
      at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:398)
      Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 211 completed: No
      at com.sun.corba.se.impl.logging.ORBUtilSystemException.ioexceptionWhenReadingConnection(ORBUtilSystemException.java:2456)
      at com.sun.corba.se.impl.logging.ORBUtilSystemException.ioexceptionWhenReadingConnection(ORBUtilSystemException.java:2474)
      at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.readGIOPHeader(MessageBase.java:116)
      at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.readGIOPMessage(MessageBase.java:98)
      at com.sun.corba.se.impl.transport.CorbaContactInfoBase.createMessageMediator(CorbaContactInfoBase.java:153)
      at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.readBits(SocketOrChannelConnectionImpl.java:314)
      ... 3 more
      Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.io.FilterInputStream.read(FilterInputStream.java:116)
      at com.wily.introscope.agent.probe.net.ManagedSocketInputStream.read(ManagedSocketInputStream.java:214)
      at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.readFully(SocketOrChannelConnectionImpl.java:664)
      at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:527)
      at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.readGIOPHeader(MessageBase.java:112)
      ... 6 more

      Could any one help me in this issue?

      Best Regards,

      Rodrigo Lima
        • 1. Re: CORBA CLIENT - SocketTimeoutException
          How did that get into the stack? And does it set a socket timeout?

          The Java SE IIOP implementation has some extraordinary code that thinks it is implementing a read timeout itself, although it isn't, but it doesn't actually call setSoTimeout() itself.

          (It relies on InputStream.read() returning zero instead of blocking if there is no data, which it doesn't do unless the buffer length is zero, which it isn't. I reported this problem many years ago, still there.)
          • 2. Re: CORBA CLIENT - SocketTimeoutException

            I implemented my own SocketFactory where i call the method setSoTimeout. The problem is that sometimes the time that i set for timeout is not considered and the i got errors in less than 1 second, but the timeout period is set for 15 seconds.

            Do you have any idea?


            Rodrigo Lima
            • 3. Re: CORBA CLIENT - SocketTimeoutException
              There already is a way to set a timeout. Set the system property
              to a colon-separated list W:G:M:F, where:

              W: initial wait time
              G: maximum wait time while reading GIOP header
              M: maximum wait time while reading message
              F: initial backoff factor.

              Default is 100:300:3000:20.
              • 4. Re: CORBA CLIENT - SocketTimeoutException

                I set this property and i use this in the ORB initialization but it does not work. I removed my own Socket factory to use the default implemented by Oracle/Sun and i guess that this property is not used by this implementation.

                I only use my own SocketFactory because I have no idea how to set the timeout in the Oracle/Sun default implementation.

                Do you know if there is another way to set this timeout?


                Rodrigo Lima