Uploaded image for project: 'fix8'
  1. fix8
  2. FX-192

Reliable session fails to re-connect on connection errors

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.2
    • Component/s: runtime
    • Labels:
      None
    • Environment:

      Linux 3.12.8-300.fc20.x86_64 #1 SMP Thu Jan 16 01:07:50 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

    • Branch:
      dev

      Description

      I am trying to run f8test. It fails to re-connect on connection errors, the log:

      0000001 A 2014-01-28 16:38:15.899097690 Starting session
      0000002 A 2014-01-28 16:38:15.899172933 Trying to connect to: 127.0.0.1:1234 (1) not-secured
      0000003 A 2014-01-28 16:38:18.899605357 exception: Timeout: connect timed out: 127.0.0.1:1234
      0000004 A 2014-01-28 16:38:21.899708275 Trying to connect to: 127.0.0.1:1234 (2) not-secured
      0000005 A 2014-01-28 16:38:21.899753531 exception: I/O error: Operation already in progress
      0000006 A 2014-01-28 16:38:24.899861928 Trying to connect to: 127.0.0.1:1234 (3) not-secured
      0000007 A 2014-01-28 16:38:24.899912132 exception: I/O error: Operation already in progress
      0000008 A 2014-01-28 16:38:27.900015726 Trying to connect to: 127.0.0.1:1234 (4) not-secured
      0000009 A 2014-01-28 16:38:27.900065533 exception: I/O error: Operation already in progress
      0000010 A 2014-01-28 16:38:30.900157618 Trying to connect to: 127.0.0.1:1234 (5) not-secured
      0000011 A 2014-01-28 16:38:30.900194326 exception: I/O error: Operation already in progress
      0000012 A 2014-01-28 16:38:33.900277207 Connection failed
      

      It basically says, that after connect() timed out, further connection attempts failed with EINPROGESS, whereas they should fail with the same error.

      Looking in the source code ClientConnection::connect() it seems that the socket is not re-created before trying to connect again.

      Also, the socket options should be set before connecting, otherwise they may have no effect, see man tcp(7):

      On individual connections, the socket buffer size must be set prior to the listen(2) or connect(2) calls in order to have it take effect. See socket(7) for more information.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                ddight David Dight
                Reporter:
                maxim.yegorushkin Maxim Yegorushkin (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Who's Looking?