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

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated: