Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5504

AsyncHTTPConduitFactory.CONNECTION_TTL has no effect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jboss-fuse-6.3
    • jboss-fuse-6.2.1
    • CXF
    • None
    • % %

      Attached is the test case you will find.

      This is how to do it:

      • start your test
      • on a console, use repeatedly the command "netstat | findstr 8123" (Windows ) or "netstat | grep 8123" (Linux) You will see that the connection is indeed dropped after 5 seconds.
        This a capture of my console showing that the connection status switches from ESTABLISHED to TIME_WAIT (which means that the connection was closed)

      Z:\java>echo %time%
      10:09:57.59

      Z:\java> netstat | findstr 8123
      TCP 127.0.0.1:1815 bewx823:8123 ESTABLISHED
      TCP 127.0.0.1:8123 bewx823:1815 ESTABLISHED

      Z:\java> netstat | findstr 8123
      TCP 127.0.0.1:1815 bewx823:8123 ESTABLISHED
      TCP 127.0.0.1:8123 bewx823:1815 ESTABLISHED

      Z:\java> netstat | findstr 8123
      TCP 127.0.0.1:1815 bewx823:8123 ESTABLISHED
      TCP 127.0.0.1:8123 bewx823:1815 ESTABLISHED

      Z:\java> netstat | findstr 8123
      TCP 127.0.0.1:1815 bewx823:8123 TIME_WAIT

      Z:\java>echo %time%
      10:10:05.66

      Moreover, I did two additional tests:

      1. I modified your test to execute two requests at an interval of 4 seconds:
      service.sayHello("Viral");
      Thread.sleep(4000);
      service.sayHello("Viral");
      Thread.sleep(120000);
      You can then see that the connection is reused for both requests. The connection with the client port 1965 is maintained open for 9 seconds (5 seconds after the second request)
      Z:\java> netstat | findstr 8123
      TCP 127.0.0.1:1965 bewx823:8123 ESTABLISHED
      TCP 127.0.0.1:8123 bewx823:1965 ESTABLISHED

      2. I execute the two requests at an interval of 6 seconds:
      service.sayHello("Viral");
      Thread.sleep(6000);
      service.sayHello("Viral");
      Thread.sleep(120000);
      You can then see that the connection is not reused. One connection is closed (with the client port 1921 ), and another one is being opened (with the client port 1922)
      Z:\java> netstat | findstr 8123
      TCP 127.0.0.1:1921 bewx823:8123 TIME_WAIT
      TCP 127.0.0.1:1922 bewx823:8123 ESTABLISHED
      TCP 127.0.0.1:8123 bewx823:1922 ESTABLISHED

      It seems that ReceiveTimeout default value always takes preference for this. We don't have any idea how the CONNECTION_TTL works.

            yfang@redhat.com Freeman(Yue) Fang
            rhn-support-vgohel Viral Gohel
            Mojmir Kubiste Mojmir Kubiste (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: