glassfish
  1. glassfish
  2. GLASSFISH-20648

EJB client frozen when ORBTCPConnectTimeouts is specified

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.0_b87_RC3
    • Fix Version/s: 4.1
    • Component/s: orb
    • Labels:
      None
    • Environment:

      Windows 7

      Description

      TCP timeout value can be specified by the property ORBTCPConnectTimeouts.
      The format of this property is com.sun.corba.ee.transport.ORBTCPConnectTimeouts=initial:max:backoff:maxsingle.
      For example, this can be specified by -D option of java command or VMARGS for appclient command.
      When the same value is specified for the "initial" and "max", the client program is frozen.

      To reproduce the problem,
      1. Create a Hello World EJB sample program.
      2. When running the EJB client program, specify the ORBTCPConnectTimeouts option and invalid server name where EJB is not running.
      eg.
      C:\>set VMARGS=-Dcom.sun.corba.ee.transport.ORBTCPConnectTimeouts=100:100:100:1000
      C:\>appclient -Dcom.sun.appserv.iiop.endpoints=invalidhost:3700 ejb30.SlessJavaClient

      3. EJB client does not timeout.(It stalls and no response.)

      I have created a sample program to reproduce the issue.
      To use the program,
      1. Edit the build.xml. Change the glassfish installation path in Line7.
      2. Execute "ant build" to compile. Then, "ant deploy" to deploy
      3. Execute "ant appclient". The program tries to connect to an invalid server and show exception. Then, exits and back to prompt. (This is expected. Not bug.)
      4. Execute "ant appclient_bug" -Dcom.sun.corba.ee.transport.ORBTCPConnectTimeouts=100:100:100:1000 is specified in this case. The program does not timeout and stalls.

      (For step 3 and 4, you can alternatively use "ant javaclient" and "ant javaclient_bug" to reproduce the bug.)

      This is from the Glassfish source code.
      It seems this part is causing the problem.

      TcpTimeoutsImpl.java original
       
      public boolean isExpired() {
      	return total_time > max_time_to_wait ;
      }
      

      Changing >= in isExpried() solves the problem. See below for the suggestion.

      TcpTimeoutsImpl.java suggested
       
      public boolean isExpired() {
      	return total_time >= max_time_to_wait ;
      }
      

        Activity

        tak09 created issue -
        Hide
        tak09 added a comment -

        I have uploaded the sample program.
        https://www.dropbox.com/sh/k1am572kybmhgx1/zeIuQ-e2s2/GLASSFISH-20648

        Please download OTBTCPConnectTimeouts.zip

        Show
        tak09 added a comment - I have uploaded the sample program. https://www.dropbox.com/sh/k1am572kybmhgx1/zeIuQ-e2s2/GLASSFISH-20648 Please download OTBTCPConnectTimeouts.zip
        Hide
        Harshad Vilekar added a comment -

        This will be fixed in the next GF release. ORB 4.0 workspace revision #930.

        Show
        Harshad Vilekar added a comment - This will be fixed in the next GF release. ORB 4.0 workspace revision #930.
        Harshad Vilekar made changes -
        Field Original Value New Value
        Fix Version/s 4.0.1 [ 16061 ]
        Romain Grécourt made changes -
        Fix Version/s 4.1 [ 16387 ]
        Fix Version/s 4.0.1 [ 16061 ]

          People

          • Assignee:
            Harshad Vilekar
            Reporter:
            tak09
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: